Record Class ConditionDamagedAtMost
java.lang.Object
java.lang.Record
com.blamejared.crafttweaker.api.ingredient.condition.type.ConditionDamagedAtMost
- All Implemented Interfaces:
IIngredientCondition
@ZenRegister
public record ConditionDamagedAtMost(int maxDamage)
extends Record
implements IIngredientCondition
-
Field Summary
Fields inherited from interface com.blamejared.crafttweaker.api.ingredient.condition.IIngredientCondition
CODEC, STREAM_CODEC -
Constructor Summary
ConstructorsConstructorDescriptionConditionDamagedAtMost(int maxDamage) Creates an instance of aConditionDamagedAtMostrecord class. -
Method Summary
Modifier and TypeMethodDescriptionPredicate<net.minecraft.core.component.DataComponentType<?>> final booleanIndicates whether some other object is "equal to" this one.getCommandString(String base) final inthashCode()Returns a hash code value for this object.booleanmatches(IItemStack stack) intReturns the value of themaxDamagerecord component.final StringtoString()Returns a string representation of this record class.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.blamejared.crafttweaker.api.ingredient.condition.IIngredientCondition
getType
-
Constructor Details
-
ConditionDamagedAtMost
public ConditionDamagedAtMost(int maxDamage) Creates an instance of aConditionDamagedAtMostrecord class.- Parameters:
maxDamage- the value for themaxDamagerecord component
-
-
Method Details
-
matches
- Specified by:
matchesin interfaceIIngredientCondition
-
componentFilter
- Specified by:
componentFilterin interfaceIIngredientCondition
-
getCommandString
- Specified by:
getCommandStringin interfaceIIngredientCondition
-
getSerializer
- Specified by:
getSerializerin interfaceIIngredientCondition
-
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 with '=='. -
maxDamage
public int maxDamage()Returns the value of themaxDamagerecord component.- Returns:
- the value of the
maxDamagerecord component
-