Class LegacyDamageTemperatureEffect
java.lang.Object
com.github.thedeathlycow.thermoo.api.temperature.effects.TemperatureEffect<LegacyDamageTemperatureEffect.Config>
com.github.thedeathlycow.thermoo.api.temperature.effects.LegacyDamageTemperatureEffect
@Deprecated(since="1.5")
public class LegacyDamageTemperatureEffect
extends TemperatureEffect<LegacyDamageTemperatureEffect.Config>
Deprecated.
Applies damage to
LivingEntitys when their temperature scale is within a given range.
The amount and interval of the damage pulses, but the damage source cannot be at this time. Instead, damage sources are
hard coded into a specific type (such as thermoo:freeze_damage_legacy).-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordDeprecated. -
Constructor Summary
ConstructorsConstructorDescriptionLegacyDamageTemperatureEffect(Function<net.minecraft.server.world.ServerWorld, net.minecraft.entity.damage.DamageSource> damageSourceSupplier) Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionvoidapply(net.minecraft.entity.LivingEntity victim, net.minecraft.server.world.ServerWorld serverWorld, LegacyDamageTemperatureEffect.Config config) Deprecated.Applies the effect to a living entityconfigFromJson(com.google.gson.JsonElement json, com.google.gson.JsonDeserializationContext context) Deprecated.Deserializes a JSON element into a new config instance that is valid for this effect typebooleanshouldApply(net.minecraft.entity.LivingEntity victim, LegacyDamageTemperatureEffect.Config config) Deprecated.Tests if the effect should be applied to a living entity.
-
Constructor Details
-
LegacyDamageTemperatureEffect
public LegacyDamageTemperatureEffect(Function<net.minecraft.server.world.ServerWorld, net.minecraft.entity.damage.DamageSource> damageSourceSupplier) Deprecated.
-
-
Method Details
-
apply
public void apply(net.minecraft.entity.LivingEntity victim, net.minecraft.server.world.ServerWorld serverWorld, LegacyDamageTemperatureEffect.Config config) Deprecated.Description copied from class:TemperatureEffectApplies the effect to a living entity- Specified by:
applyin classTemperatureEffect<LegacyDamageTemperatureEffect.Config>- Parameters:
victim- The living entity to apply the effect toserverWorld- The server world of the victimconfig- The effect config
-
shouldApply
public boolean shouldApply(net.minecraft.entity.LivingEntity victim, LegacyDamageTemperatureEffect.Config config) Deprecated.Description copied from class:TemperatureEffectTests if the effect should be applied to a living entity. Note that even if this returnstrue, the effect is not guaranteed to be applied. This is because all entity must pass the predicate specified byConfiguredTemperatureEffect.predicate.- Specified by:
shouldApplyin classTemperatureEffect<LegacyDamageTemperatureEffect.Config>- Parameters:
victim- The victim to test if the effect should be applied toconfig- The effect config- Returns:
- Returns if the effect should be applied to the victim
-
configFromJson
public LegacyDamageTemperatureEffect.Config configFromJson(com.google.gson.JsonElement json, com.google.gson.JsonDeserializationContext context) throws com.google.gson.JsonSyntaxException Deprecated.Description copied from class:TemperatureEffectDeserializes a JSON element into a new config instance that is valid for this effect type- Specified by:
configFromJsonin classTemperatureEffect<LegacyDamageTemperatureEffect.Config>- Parameters:
json- The JSON element that represents the config of this effect typecontext- The JSON deserialization context- Returns:
- Returns a new config instance specified by the JSON element given
- Throws:
com.google.gson.JsonSyntaxException- Thrown if the given JSON element is not a legal representation of the config for this effect type
-
DamageTemperatureEffectinstead