Package com.mrbysco.emiprofessions.emi
Record Class ProfessionEntry
java.lang.Object
java.lang.Record
com.mrbysco.emiprofessions.emi.ProfessionEntry
- Record Components:
profession- The professionblockStacks- The workstation blocks for the profession
public record ProfessionEntry(net.minecraft.world.entity.npc.VillagerProfession profession, List<net.minecraft.world.item.ItemStack> blockStacks)
extends Record
A record to hold the profession and the block stacks for the profession
-
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.VillagerGet the villager entity for the professionfinal 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.
-
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()Get the villager entity for the profession- Returns:
- The Villager entity
-
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
-