Class StochasticDegradationEffect

java.lang.Object
org.cyclops.evilcraft.core.degradation.StochasticDegradationEffect
All Implemented Interfaces:
IDegradationEffect
Direct Known Subclasses:
MobSpawnDegradation, SoundDegradation, TerraformDegradation

public abstract class StochasticDegradationEffect extends Object implements IDegradationEffect
A IDegradationEffect that can be executed with a certain chance. It will take into account the current degradation factor and the higher this is, the higher the chance of the execution of this effect. An optional chance can also be given for a chance next to the degradation chance.
  • Constructor Details

  • Method Details

    • canRun

      public boolean canRun(IDegradable degradable)
      Description copied from interface: IDegradationEffect
      If this effect can occur.
      Specified by:
      canRun in interface IDegradationEffect
      Parameters:
      degradable - The degradable instance where the effect should apply.
      Returns:
      If it can occur.
    • getChance

      public double getChance()
      Get the configured chance on occuring.
      Returns:
      The chance.