Package net.minecraft.world.entity.npc
Record Class VillagerProfession
java.lang.Object
java.lang.Record
net.minecraft.world.entity.npc.VillagerProfession
-
Field Summary
FieldsModifier and TypeFieldDescriptionThe field for theacquirableJobSiterecord component.static final VillagerProfessionstatic final VillagerProfessionstatic final VillagerProfessionstatic final VillagerProfessionstatic final VillagerProfessionstatic final VillagerProfessionstatic final VillagerProfessionThe field for theheldJobSiterecord component.static final VillagerProfessionstatic final VillagerProfessionstatic final VillagerProfessionprivate final StringThe field for thenamerecord component.static final VillagerProfessionstatic final VillagerProfessionprivate final com.google.common.collect.ImmutableSet<Item>The field for therequestedItemsrecord component.private final com.google.common.collect.ImmutableSet<Block>The field for thesecondaryPoirecord component.static final VillagerProfessionstatic final VillagerProfessionstatic final VillagerProfessionprivate final SoundEventThe field for theworkSoundrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionVillagerProfession(String name, Predicate<Holder<PoiType>> heldJobSite, Predicate<Holder<PoiType>> acquirableJobSite, com.google.common.collect.ImmutableSet<Item> requestedItems, com.google.common.collect.ImmutableSet<Block> secondaryPoi, SoundEvent workSound) Creates an instance of aVillagerProfessionrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theacquirableJobSiterecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of theheldJobSiterecord component.name()Returns the value of thenamerecord component.private static VillagerProfessionregister(String p_219659_, Predicate<Holder<PoiType>> p_219660_, Predicate<Holder<PoiType>> p_219661_, com.google.common.collect.ImmutableSet<Item> p_219662_, com.google.common.collect.ImmutableSet<Block> p_219663_, SoundEvent p_219664_) private static VillagerProfessionregister(String p_219654_, Predicate<Holder<PoiType>> p_219655_, Predicate<Holder<PoiType>> p_219656_, SoundEvent p_219657_) private static VillagerProfessionregister(String p_219648_, ResourceKey<PoiType> p_219649_, com.google.common.collect.ImmutableSet<Item> p_219650_, com.google.common.collect.ImmutableSet<Block> p_219651_, SoundEvent p_219652_) private static VillagerProfessionregister(String p_219644_, ResourceKey<PoiType> p_219645_, SoundEvent p_219646_) com.google.common.collect.ImmutableSet<Item>Returns the value of therequestedItemsrecord component.com.google.common.collect.ImmutableSet<Block>Returns the value of thesecondaryPoirecord component.toString()Returns a string representation of this record class.Returns the value of theworkSoundrecord component.
-
Field Details
-
name
The field for thenamerecord component. -
heldJobSite
The field for theheldJobSiterecord component. -
acquirableJobSite
The field for theacquirableJobSiterecord component. -
requestedItems
The field for therequestedItemsrecord component. -
secondaryPoi
The field for thesecondaryPoirecord component. -
workSound
The field for theworkSoundrecord component. -
ALL_ACQUIRABLE_JOBS
-
NONE
-
ARMORER
-
BUTCHER
-
CARTOGRAPHER
-
CLERIC
-
FARMER
-
FISHERMAN
-
FLETCHER
-
LEATHERWORKER
-
LIBRARIAN
-
MASON
-
NITWIT
-
SHEPHERD
-
TOOLSMITH
-
WEAPONSMITH
-
-
Constructor Details
-
VillagerProfession
public VillagerProfession(String name, Predicate<Holder<PoiType>> heldJobSite, Predicate<Holder<PoiType>> acquirableJobSite, com.google.common.collect.ImmutableSet<Item> requestedItems, com.google.common.collect.ImmutableSet<Block> secondaryPoi, @Nullable SoundEvent workSound) Creates an instance of aVillagerProfessionrecord class.- Parameters:
name- the value for thenamerecord componentheldJobSite- the value for theheldJobSiterecord componentacquirableJobSite- the value for theacquirableJobSiterecord componentrequestedItems- the value for therequestedItemsrecord componentsecondaryPoi- the value for thesecondaryPoirecord componentworkSound- the value for theworkSoundrecord component
-
-
Method Details
-
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. -
register
private static VillagerProfession register(String p_219644_, ResourceKey<PoiType> p_219645_, @Nullable SoundEvent p_219646_) -
register
private static VillagerProfession register(String p_219654_, Predicate<Holder<PoiType>> p_219655_, Predicate<Holder<PoiType>> p_219656_, @Nullable SoundEvent p_219657_) -
register
private static VillagerProfession register(String p_219648_, ResourceKey<PoiType> p_219649_, com.google.common.collect.ImmutableSet<Item> p_219650_, com.google.common.collect.ImmutableSet<Block> p_219651_, @Nullable SoundEvent p_219652_) -
register
-
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). -
name
Returns the value of thenamerecord component.- Returns:
- the value of the
namerecord component
-
heldJobSite
Returns the value of theheldJobSiterecord component.- Returns:
- the value of the
heldJobSiterecord component
-
acquirableJobSite
Returns the value of theacquirableJobSiterecord component.- Returns:
- the value of the
acquirableJobSiterecord component
-
requestedItems
Returns the value of therequestedItemsrecord component.- Returns:
- the value of the
requestedItemsrecord component
-
secondaryPoi
Returns the value of thesecondaryPoirecord component.- Returns:
- the value of the
secondaryPoirecord component
-
workSound
Returns the value of theworkSoundrecord component.- Returns:
- the value of the
workSoundrecord component
-