Record Class SoakedLootCondition
java.lang.Object
java.lang.Record
com.github.thedeathlycow.thermoo.api.predicate.SoakedLootCondition
- Record Components:
value- The soaking valuescale- The soaking scale
- All Implemented Interfaces:
Predicate<net.minecraft.loot.context.LootContext>,net.minecraft.loot.condition.LootCondition,net.minecraft.loot.context.LootContextAware
public record SoakedLootCondition(net.minecraft.predicate.NumberRange.IntRange value, net.minecraft.predicate.NumberRange.DoubleRange scale)
extends Record
implements net.minecraft.loot.condition.LootCondition
Loot condition used to test the soaking values of an entity in a predicate. Only works for entities that implement
Soakable, which by default is only LivingEntity. All other entities will return
always false.-
Nested Class Summary
Nested classes/interfaces inherited from interface net.minecraft.loot.condition.LootCondition
net.minecraft.loot.condition.LootCondition.Builder -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.MapCodec<SoakedLootCondition> Fields inherited from interface net.minecraft.loot.condition.LootCondition
BASE_CODEC, ENTRY_CODEC -
Constructor Summary
ConstructorsConstructorDescriptionSoakedLootCondition(net.minecraft.predicate.NumberRange.IntRange value, net.minecraft.predicate.NumberRange.DoubleRange scale) Creates an instance of aSoakedLootConditionrecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic net.minecraft.loot.condition.LootCondition.Builderbuilder(net.minecraft.predicate.NumberRange.DoubleRange scale) static net.minecraft.loot.condition.LootCondition.Builderbuilder(net.minecraft.predicate.NumberRange.IntRange value) final booleanIndicates whether some other object is "equal to" this one.net.minecraft.loot.condition.LootConditionTypegetType()final inthashCode()Returns a hash code value for this object.net.minecraft.predicate.NumberRange.DoubleRangescale()Returns the value of thescalerecord component.booleantest(net.minecraft.loot.context.LootContext lootContext) final StringtoString()Returns a string representation of this record class.net.minecraft.predicate.NumberRange.IntRangevalue()Returns the value of thevaluerecord component.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface net.minecraft.loot.context.LootContextAware
getAllowedParameters, validate
-
Field Details
-
CODEC
-
-
Constructor Details
-
SoakedLootCondition
public SoakedLootCondition(net.minecraft.predicate.NumberRange.IntRange value, net.minecraft.predicate.NumberRange.DoubleRange scale) Creates an instance of aSoakedLootConditionrecord class.
-
-
Method Details
-
getType
public net.minecraft.loot.condition.LootConditionType getType()- Specified by:
getTypein interfacenet.minecraft.loot.condition.LootCondition
-
test
public boolean test(net.minecraft.loot.context.LootContext lootContext) -
builder
public static net.minecraft.loot.condition.LootCondition.Builder builder(net.minecraft.predicate.NumberRange.IntRange value) -
builder
public static net.minecraft.loot.condition.LootCondition.Builder builder(net.minecraft.predicate.NumberRange.DoubleRange scale) -
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
value
public net.minecraft.predicate.NumberRange.IntRange value()Returns the value of thevaluerecord component.- Returns:
- the value of the
valuerecord component
-
scale
public net.minecraft.predicate.NumberRange.DoubleRange scale()Returns the value of thescalerecord component.- Returns:
- the value of the
scalerecord component
-