Record Class VillagerCompostable
java.lang.Object
java.lang.Record
net.neoforged.neoforge.registries.datamaps.builtin.VillagerCompostable
- Record Components:
canVillagerCompost- whether farmer villagers can compost the item
Data map value for compostables.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<VillagerCompostable> private final booleanThe field for thecanVillagerCompostrecord component.static final com.mojang.serialization.Codec<VillagerCompostable> -
Constructor Summary
ConstructorsConstructorDescriptionVillagerCompostable(boolean canVillagerCompost) Creates an instance of aVillagerCompostablerecord class. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns the value of thecanVillagerCompostrecord 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
-
canVillagerCompost
private final boolean canVillagerCompostThe field for thecanVillagerCompostrecord component. -
BOOLEAN_CODEC
-
CODEC
-
-
Constructor Details
-
VillagerCompostable
public VillagerCompostable(boolean canVillagerCompost) Creates an instance of aVillagerCompostablerecord class.- Parameters:
canVillagerCompost- the value for thecanVillagerCompostrecord 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. All components in this record class are compared with thecomparemethod from their corresponding wrapper classes. -
canVillagerCompost
public boolean canVillagerCompost()Returns the value of thecanVillagerCompostrecord component.- Returns:
- the value of the
canVillagerCompostrecord component
-