Record Class ProfessionEntry
java.lang.Object
java.lang.Record
com.mrbysco.roughlyenoughprofessions.profession.ProfessionEntry
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<ProfessionEntry> static final net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf, ProfessionEntry> -
Constructor Summary
ConstructorsConstructorDescriptionProfessionEntry(net.minecraft.world.entity.npc.VillagerProfession profession, List<net.minecraft.world.item.ItemStack> blockStacks) Creates an instance of aProfessionEntryrecord class. -
Method Summary
Modifier and TypeMethodDescriptionList<net.minecraft.world.item.ItemStack> Returns the value of theblockStacksrecord component.final booleanIndicates whether some other object is "equal to" this one.@Nullable net.minecraft.world.entity.npc.Villagerfinal inthashCode()Returns a hash code value for this object.net.minecraft.world.entity.npc.VillagerProfessionReturns the value of theprofessionrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
CODEC
-
STREAM_CODEC
public static final net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf,ProfessionEntry> STREAM_CODEC
-
-
Constructor Details
-
ProfessionEntry
public ProfessionEntry(net.minecraft.world.entity.npc.VillagerProfession profession, List<net.minecraft.world.item.ItemStack> blockStacks) Creates an instance of aProfessionEntryrecord class.- Parameters:
profession- the value for theprofessionrecord componentblockStacks- the value for theblockStacksrecord component
-
-
Method Details
-
getVillagerEntity
@Nullable public @Nullable net.minecraft.world.entity.npc.Villager getVillagerEntity() -
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). -
profession
public net.minecraft.world.entity.npc.VillagerProfession profession()Returns the value of theprofessionrecord component.- Returns:
- the value of the
professionrecord component
-
blockStacks
Returns the value of theblockStacksrecord component.- Returns:
- the value of the
blockStacksrecord component
-