Class DegradationExecutor
java.lang.Object
org.cyclops.evilcraft.core.degradation.DegradationExecutor
An executor component to be used by
IDegradable.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintvoidread(net.minecraft.nbt.CompoundTag compound) Reads the data for this executor from NBT.booleanrunRandomEffect(boolean isClientSide) Execute a randomIDegradationEffectif the tick is at the correct value that as defined ingetTickInterval().voidsetTickInterval(int tickInterval) voidwrite(net.minecraft.nbt.CompoundTag compound) Writes the data for this executor to NBT.
-
Constructor Details
-
DegradationExecutor
Make a new instance.- Parameters:
degradable- TheIDegradablethis executor applies to.
-
-
Method Details
-
runRandomEffect
public boolean runRandomEffect(boolean isClientSide) Execute a randomIDegradationEffectif the tick is at the correct value that as defined ingetTickInterval(). Each time this method is called, the tick is increased.- Parameters:
isClientSide- True for clients, false for servers.- Returns:
- If a random effect was executed, can be false if the tick is too small or the randomly chosen effect can not be run.
-
read
public void read(net.minecraft.nbt.CompoundTag compound) Reads the data for this executor from NBT.- Parameters:
compound- The tag to read from.
-
write
public void write(net.minecraft.nbt.CompoundTag compound) Writes the data for this executor to NBT.- Parameters:
compound- The tag to write to.
-
getTickInterval
public int getTickInterval()- Returns:
- the tickInterval
-
setTickInterval
public void setTickInterval(int tickInterval) - Parameters:
tickInterval- the tickInterval to set
-