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.core.Holder<net.minecraft.world.entity.npc.villager.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.villager.Villagerfinal inthashCode()Returns a hash code value for this object.net.minecraft.core.Holder<net.minecraft.world.entity.npc.villager.VillagerProfession> Returns 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.core.Holder<net.minecraft.world.entity.npc.villager.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.Villager getVillagerEntity() -
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 withObjects::equals(Object,Object). -
profession
public net.minecraft.core.Holder<net.minecraft.world.entity.npc.villager.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
-