Package net.minecraft.world.entity.npc
Record Class VillagerProfession
java.lang.Object
java.lang.Record
net.minecraft.world.entity.npc.VillagerProfession
-
Field Summary
Modifier and TypeFieldDescriptionThe field for theacquirableJobSite
record component.static final VillagerProfession
static final VillagerProfession
static final VillagerProfession
static final VillagerProfession
static final VillagerProfession
static final VillagerProfession
static final VillagerProfession
The field for theheldJobSite
record component.static final VillagerProfession
static final VillagerProfession
static final VillagerProfession
private final String
The field for thename
record component.static final VillagerProfession
static final VillagerProfession
private final com.google.common.collect.ImmutableSet
<Item> The field for therequestedItems
record component.private final com.google.common.collect.ImmutableSet
<Block> The field for thesecondaryPoi
record component.static final VillagerProfession
static final VillagerProfession
static final VillagerProfession
private final SoundEvent
The field for theworkSound
record component. -
Constructor Summary
ConstructorDescriptionVillagerProfession
(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 aVillagerProfession
record class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theacquirableJobSite
record component.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.Returns the value of theheldJobSite
record component.name()
Returns the value of thename
record component.private static VillagerProfession
register
(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 VillagerProfession
register
(String p_219654_, Predicate<Holder<PoiType>> p_219655_, Predicate<Holder<PoiType>> p_219656_, SoundEvent p_219657_) 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_, SoundEvent p_219652_) private static VillagerProfession
register
(String p_219644_, ResourceKey<PoiType> p_219645_, SoundEvent p_219646_) com.google.common.collect.ImmutableSet
<Item> Returns the value of therequestedItems
record component.com.google.common.collect.ImmutableSet
<Block> Returns the value of thesecondaryPoi
record component.toString()
Returns a string representation of this record class.Returns the value of theworkSound
record component.
-
Field Details
-
name
The field for thename
record component. -
heldJobSite
The field for theheldJobSite
record component. -
acquirableJobSite
The field for theacquirableJobSite
record component. -
requestedItems
The field for therequestedItems
record component. -
secondaryPoi
The field for thesecondaryPoi
record component. -
workSound
The field for theworkSound
record 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 aVillagerProfession
record class.- Parameters:
name
- the value for thename
record componentheldJobSite
- the value for theheldJobSite
record componentacquirableJobSite
- the value for theacquirableJobSite
record componentrequestedItems
- the value for therequestedItems
record componentsecondaryPoi
- the value for thesecondaryPoi
record componentworkSound
- the value for theworkSound
record 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 thename
record component.- Returns:
- the value of the
name
record component
-
heldJobSite
Returns the value of theheldJobSite
record component.- Returns:
- the value of the
heldJobSite
record component
-
acquirableJobSite
Returns the value of theacquirableJobSite
record component.- Returns:
- the value of the
acquirableJobSite
record component
-
requestedItems
Returns the value of therequestedItems
record component.- Returns:
- the value of the
requestedItems
record component
-
secondaryPoi
Returns the value of thesecondaryPoi
record component.- Returns:
- the value of the
secondaryPoi
record component
-
workSound
Returns the value of theworkSound
record component.- Returns:
- the value of the
workSound
record component
-