public abstract class StochasticDegradationEffect extends ConfigurableDegradationEffect
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.eConfig| Constructor and Description |
|---|
StochasticDegradationEffect(ExtendedConfig<DegradationEffectConfig> eConfig)
Make a new instance.
|
StochasticDegradationEffect(ExtendedConfig<DegradationEffectConfig> eConfig,
double chance)
Make a new instance.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
canRun(IDegradable degradable)
If this effect can occur.
|
double |
getChance()
Get the configured chance on occuring.
|
getConfigclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitrunClientSide, runServerSidepublic StochasticDegradationEffect(ExtendedConfig<DegradationEffectConfig> eConfig, double chance)
eConfig - The config.chance - The chance on occuring. A value between 0 and 1.public StochasticDegradationEffect(ExtendedConfig<DegradationEffectConfig> eConfig)
eConfig - The config.public boolean canRun(IDegradable degradable)
IDegradationEffectdegradable - The degradable instance where the effect should apply.public double getChance()