Record Class VanillaItemCodecs.FoodOnAStick
java.lang.Object
java.lang.Record
net.rebel459.unified.api.registry.VanillaItemCodecs.FoodOnAStick
- Enclosing class:
VanillaItemCodecs
public static record VanillaItemCodecs.FoodOnAStick(net.minecraft.world.entity.EntityType<?> canInteractWith, int consumeItemDamage)
extends Record
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.MapCodec<VanillaItemCodecs.FoodOnAStick> -
Constructor Summary
ConstructorsConstructorDescriptionFoodOnAStick(net.minecraft.world.entity.EntityType<?> canInteractWith, int consumeItemDamage) Creates an instance of aFoodOnAStickrecord class. -
Method Summary
Modifier and TypeMethodDescriptionnet.minecraft.world.entity.EntityType<?> Returns the value of thecanInteractWithrecord component.intReturns the value of theconsumeItemDamagerecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
CODEC
-
-
Constructor Details
-
FoodOnAStick
public FoodOnAStick(net.minecraft.world.entity.EntityType<?> canInteractWith, int consumeItemDamage) Creates an instance of aFoodOnAStickrecord class.- Parameters:
canInteractWith- the value for thecanInteractWithrecord componentconsumeItemDamage- the value for theconsumeItemDamagerecord component
-
-
Method Details
-
toString
-
hashCode
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
canInteractWith
public net.minecraft.world.entity.EntityType<?> canInteractWith()Returns the value of thecanInteractWithrecord component.- Returns:
- the value of the
canInteractWithrecord component
-
consumeItemDamage
public int consumeItemDamage()Returns the value of theconsumeItemDamagerecord component.- Returns:
- the value of the
consumeItemDamagerecord component
-