Class EmptyTemperatureEffect

java.lang.Object
com.github.thedeathlycow.thermoo.api.temperature.effects.TemperatureEffect<EmptyTemperatureEffect.Config>
com.github.thedeathlycow.thermoo.api.temperature.effects.EmptyTemperatureEffect

public final class EmptyTemperatureEffect extends TemperatureEffect<EmptyTemperatureEffect.Config>
Represents an 'empty' temperature effect that is never applied and does nothing.

Primarily used for overriding lower-priority effects of the same identifier in order to disable them.

  • Constructor Details

    • EmptyTemperatureEffect

      public EmptyTemperatureEffect()
  • Method Details

    • apply

      public void apply(net.minecraft.entity.LivingEntity victim, net.minecraft.server.world.ServerWorld serverWorld, EmptyTemperatureEffect.Config config)
      Description copied from class: TemperatureEffect
      Applies the effect to a living entity
      Specified by:
      apply in class TemperatureEffect<EmptyTemperatureEffect.Config>
      Parameters:
      victim - The living entity to apply the effect to
      serverWorld - The server world of the victim
      config - The effect config
    • shouldApply

      public boolean shouldApply(net.minecraft.entity.LivingEntity victim, EmptyTemperatureEffect.Config config)
      Description copied from class: TemperatureEffect
      Tests if the effect should be applied to a living entity. Note that even if this returns true, the effect is not guaranteed to be applied. This is because all entity must pass the predicate specified by ConfiguredTemperatureEffect.predicate.
      Specified by:
      shouldApply in class TemperatureEffect<EmptyTemperatureEffect.Config>
      Parameters:
      victim - The victim to test if the effect should be applied to
      config - The effect config
      Returns:
      Returns if the effect should be applied to the victim
    • configFromJson

      public EmptyTemperatureEffect.Config configFromJson(com.google.gson.JsonElement json, com.google.gson.JsonDeserializationContext context) throws com.google.gson.JsonSyntaxException
      Description copied from class: TemperatureEffect
      Deserializes a JSON element into a new config instance that is valid for this effect type
      Specified by:
      configFromJson in class TemperatureEffect<EmptyTemperatureEffect.Config>
      Parameters:
      json - The JSON element that represents the config of this effect type
      context - 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