Class ConfiguredTemperatureEffect<C>
java.lang.Object
com.github.thedeathlycow.thermoo.api.temperature.effects.ConfiguredTemperatureEffect<C>
- Type Parameters:
C- The config type
Represents a configured instance of a
TemperatureEffect type.
See the wiki page for details on
how to implement this in a datapack.- See Also:
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionConfiguredTemperatureEffect(TemperatureEffect<C> type, C config, @Nullable net.minecraft.loot.condition.LootCondition predicate, net.minecraft.predicate.NumberRange.FloatRange temperatureScaleRange) -
Method Summary
Modifier and TypeMethodDescriptionvoidapplyIfPossible(net.minecraft.entity.LivingEntity victim) Tests and applies this effect to a living entity if possiblestatic <C> ConfiguredTemperatureEffect<C>fromJson(TemperatureEffect<C> type, com.google.gson.JsonElement configJson, com.google.gson.JsonDeserializationContext context, @Nullable net.minecraft.loot.condition.LootCondition predicate, net.minecraft.predicate.NumberRange.FloatRange temperatureScaleRange) Constructs a newConfiguredTemperatureEffectof a specified type and config JSON object
-
Constructor Details
-
ConfiguredTemperatureEffect
public ConfiguredTemperatureEffect(TemperatureEffect<C> type, C config, @Nullable @Nullable net.minecraft.loot.condition.LootCondition predicate, net.minecraft.predicate.NumberRange.FloatRange temperatureScaleRange)
-
-
Method Details
-
fromJson
public static <C> ConfiguredTemperatureEffect<C> fromJson(TemperatureEffect<C> type, com.google.gson.JsonElement configJson, com.google.gson.JsonDeserializationContext context, @Nullable @Nullable net.minecraft.loot.condition.LootCondition predicate, net.minecraft.predicate.NumberRange.FloatRange temperatureScaleRange) throws com.google.gson.JsonSyntaxException Constructs a newConfiguredTemperatureEffectof a specified type and config JSON object- Type Parameters:
C- The type of the effect type config- Parameters:
type- The type of the effect to createconfigJson- The config of the typecontext- The JSON deserialization contextpredicate- The entity predicate of the effecttemperatureScaleRange- Temperature scale range predicate- Returns:
- Returns a new
ConfiguredTemperatureEffectbased on the JSON representation given byconfigJson - Throws:
com.google.gson.JsonParseException- Thrown ifconfigJsonis not a valid representation of the config typeCcom.google.gson.JsonSyntaxException
-
applyIfPossible
public void applyIfPossible(net.minecraft.entity.LivingEntity victim) Tests and applies this effect to a living entity if possible- Parameters:
victim- The living entity to possibly apply the effect to
-