public abstract class StochasticDegradationEffect extends java.lang.Object implements IDegradationEffect
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 and Description |
|---|
StochasticDegradationEffect(DegradationEffectConfig eConfig) |
StochasticDegradationEffect(DegradationEffectConfig eConfig,
double chance) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
canRun(IDegradable degradable)
If this effect can occur.
|
double |
getChance()
Get the configured chance on occuring.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitrunClientSide, runServerSidepublic StochasticDegradationEffect(DegradationEffectConfig eConfig, double chance)
public StochasticDegradationEffect(DegradationEffectConfig eConfig)
public boolean canRun(IDegradable degradable)
IDegradationEffectcanRun in interface IDegradationEffectdegradable - The degradable instance where the effect should apply.public double getChance()