Class ConfiguredTemperatureEffect<C>

java.lang.Object
com.github.thedeathlycow.thermoo.api.temperature.effects.ConfiguredTemperatureEffect<C>
Type Parameters:
C - The config type

public final class ConfiguredTemperatureEffect<C> extends Object
Represents a configured instance of a TemperatureEffect type. See the wiki page for details on how to implement this in a datapack.

A configured temperature effect is more like an instance of a temperature effect, and this is the class that is directly instantiated from a temperature effect JSON file in a datapack.

See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final com.mojang.serialization.Codec<ConfiguredTemperatureEffect<?>>
    Codec for all configured temperature effects.
  • Constructor Summary

    Constructors
    Constructor
    Description
    ConfiguredTemperatureEffect(TemperatureEffect<C> type, C config, Optional<net.minecraft.world.level.storage.loot.predicates.LootItemCondition> predicate, net.minecraft.core.HolderSet<net.minecraft.world.entity.EntityType<?>> entityTypes, net.minecraft.advancements.critereon.MinMaxBounds.Doubles temperatureScaleRange, int loadingPriority)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    apply(net.minecraft.world.entity.LivingEntity victim)
    Tests and applies this effect to a living entity, and returns success if it was applied.
    void
    applyIfPossible(net.minecraft.world.entity.LivingEntity victim)
    Deprecated.
     
    net.minecraft.core.HolderSet<net.minecraft.world.entity.EntityType<?>>
     
    int
     
    Optional<net.minecraft.world.level.storage.loot.predicates.LootItemCondition>
     
    void
    remove(net.minecraft.world.entity.LivingEntity victim)
    Called the first tick that a configured temperature effect could not be applied
    net.minecraft.advancements.critereon.MinMaxBounds.Doubles
     
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • CODEC

      public static final com.mojang.serialization.Codec<ConfiguredTemperatureEffect<?>> CODEC
      Codec for all configured temperature effects. Dispatches config codec based on type.
  • Constructor Details

    • ConfiguredTemperatureEffect

      @Internal public ConfiguredTemperatureEffect(TemperatureEffect<C> type, C config, Optional<net.minecraft.world.level.storage.loot.predicates.LootItemCondition> predicate, net.minecraft.core.HolderSet<net.minecraft.world.entity.EntityType<?>> entityTypes, net.minecraft.advancements.critereon.MinMaxBounds.Doubles temperatureScaleRange, int loadingPriority)
  • Method Details

    • applyIfPossible

      @Deprecated public void applyIfPossible(net.minecraft.world.entity.LivingEntity victim)
      Deprecated.
      Tests and applies this effect to a living entity if possible
      Parameters:
      victim - The living entity to possibly apply the effect to
    • apply

      public boolean apply(net.minecraft.world.entity.LivingEntity victim)
      Tests and applies this effect to a living entity, and returns success if it was applied.

      Returns false on client.

      Parameters:
      victim - The living entity to possibly apply the effect to
      Returns:
      Returns true if the effect was applied.
    • remove

      public void remove(net.minecraft.world.entity.LivingEntity victim)
      Called the first tick that a configured temperature effect could not be applied
      Parameters:
      victim - The entity the effect was applied to
    • type

      public TemperatureEffect<C> type()
    • config

      public C config()
    • predicate

      public Optional<net.minecraft.world.level.storage.loot.predicates.LootItemCondition> predicate()
    • entityTypes

      public net.minecraft.core.HolderSet<net.minecraft.world.entity.EntityType<?>> entityTypes()
    • temperatureScaleRange

      public net.minecraft.advancements.critereon.MinMaxBounds.Doubles temperatureScaleRange()
    • loadingPriority

      public int loadingPriority()