Class DegradationExecutor

java.lang.Object
org.cyclops.evilcraft.core.degradation.DegradationExecutor

public class DegradationExecutor extends Object
An executor component to be used by IDegradable.
  • Constructor Details

    • DegradationExecutor

      public DegradationExecutor(IDegradable degradable)
      Make a new instance.
      Parameters:
      degradable - The IDegradable this executor applies to.
  • Method Details

    • runRandomEffect

      public boolean runRandomEffect(boolean isClientSide)
      Execute a random IDegradationEffect if the tick is at the correct value that as defined in getTickInterval(). 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