Record Class VillagerProfession
java.lang.Object
java.lang.Record
net.minecraft.world.entity.npc.villager.VillagerProfession
public record VillagerProfession(Component name, Predicate<Holder<PoiType>> heldJobSite, Predicate<Holder<PoiType>> acquirableJobSite, ImmutableSet<Item> requestedItems, ImmutableSet<Block> secondaryPoi, @Nullable SoundEvent workSound, it.unimi.dsi.fastutil.ints.Int2ObjectMap<ResourceKey<TradeSet>> tradeSetsByLevel)
extends Record
-
Field Summary
FieldsModifier and TypeFieldDescriptionThe field for theacquirableJobSiterecord component.static final ResourceKey<VillagerProfession> static final ResourceKey<VillagerProfession> static final ResourceKey<VillagerProfession> static final ResourceKey<VillagerProfession> static final ResourceKey<VillagerProfession> static final ResourceKey<VillagerProfession> static final ResourceKey<VillagerProfession> The field for theheldJobSiterecord component.static final ResourceKey<VillagerProfession> static final ResourceKey<VillagerProfession> static final ResourceKey<VillagerProfession> private final ComponentThe field for thenamerecord component.static final ResourceKey<VillagerProfession> static final ResourceKey<VillagerProfession> private final ImmutableSet<Item> The field for therequestedItemsrecord component.private final ImmutableSet<Block> The field for thesecondaryPoirecord component.static final ResourceKey<VillagerProfession> static final ResourceKey<VillagerProfession> private final it.unimi.dsi.fastutil.ints.Int2ObjectMap<ResourceKey<TradeSet>> The field for thetradeSetsByLevelrecord component.static final ResourceKey<VillagerProfession> private final @Nullable SoundEventThe field for theworkSoundrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionVillagerProfession(Component name, Predicate<Holder<PoiType>> heldJobSite, Predicate<Holder<PoiType>> acquirableJobSite, ImmutableSet<Item> requestedItems, ImmutableSet<Block> secondaryPoi, @Nullable SoundEvent workSound, it.unimi.dsi.fastutil.ints.Int2ObjectMap<ResourceKey<TradeSet>> tradeSetsByLevel) Creates an instance of aVillagerProfessionrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theacquirableJobSiterecord component.static VillagerProfessionbootstrap(Registry<VillagerProfession> registry) private static ResourceKey<VillagerProfession> final booleanIndicates whether some other object is "equal to" this one.@Nullable ResourceKey<TradeSet> getTrades(int level) 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(Registry<VillagerProfession> registry, ResourceKey<VillagerProfession> name, Predicate<Holder<PoiType>> heldJobSite, Predicate<Holder<PoiType>> acquirableJobSite, ImmutableSet<Item> requestedItems, ImmutableSet<Block> secondaryPoi, @Nullable SoundEvent workSound, it.unimi.dsi.fastutil.ints.Int2ObjectMap<ResourceKey<TradeSet>> trades) private static VillagerProfessionregister(Registry<VillagerProfession> registry, ResourceKey<VillagerProfession> name, Predicate<Holder<PoiType>> heldJobSite, Predicate<Holder<PoiType>> acquirableJobSite, @Nullable SoundEvent workSound) private static VillagerProfessionregister(Registry<VillagerProfession> registry, ResourceKey<VillagerProfession> name, Predicate<Holder<PoiType>> heldJobSite, Predicate<Holder<PoiType>> acquirableJobSite, @Nullable SoundEvent workSound, it.unimi.dsi.fastutil.ints.Int2ObjectMap<ResourceKey<TradeSet>> trades) private static VillagerProfessionregister(Registry<VillagerProfession> registry, ResourceKey<VillagerProfession> name, ResourceKey<PoiType> jobSite, ImmutableSet<Item> requestedItems, ImmutableSet<Block> secondaryPoi, @Nullable SoundEvent workSound, it.unimi.dsi.fastutil.ints.Int2ObjectMap<ResourceKey<TradeSet>> trades) private static VillagerProfessionregister(Registry<VillagerProfession> registry, ResourceKey<VillagerProfession> name, ResourceKey<PoiType> jobSite, @Nullable SoundEvent workSound, it.unimi.dsi.fastutil.ints.Int2ObjectMap<ResourceKey<TradeSet>> trades) Returns the value of therequestedItemsrecord component.Returns the value of thesecondaryPoirecord component.final StringtoString()Returns a string representation of this record class.it.unimi.dsi.fastutil.ints.Int2ObjectMap<ResourceKey<TradeSet>> Returns the value of thetradeSetsByLevelrecord component.@Nullable SoundEventReturns the value of theworkSoundrecord component.
-
Field Details
-
name
The field for thenamerecord component. -
heldJobSite
-
acquirableJobSite
-
requestedItems
The field for therequestedItemsrecord component. -
secondaryPoi
The field for thesecondaryPoirecord component. -
workSound
The field for theworkSoundrecord component. -
tradeSetsByLevel
The field for thetradeSetsByLevelrecord component. -
ALL_ACQUIRABLE_JOBS
-
NONE
-
ARMORER
-
BUTCHER
-
CARTOGRAPHER
-
CLERIC
-
FARMER
-
FISHERMAN
-
FLETCHER
-
LEATHERWORKER
-
LIBRARIAN
-
MASON
-
NITWIT
-
SHEPHERD
-
TOOLSMITH
-
WEAPONSMITH
-
-
Constructor Details
-
VillagerProfession
public VillagerProfession(Component name, Predicate<Holder<PoiType>> heldJobSite, Predicate<Holder<PoiType>> acquirableJobSite, ImmutableSet<Item> requestedItems, ImmutableSet<Block> secondaryPoi, @Nullable SoundEvent workSound, it.unimi.dsi.fastutil.ints.Int2ObjectMap<ResourceKey<TradeSet>> tradeSetsByLevel) 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 componenttradeSetsByLevel- the value for thetradeSetsByLevelrecord component
-
-
Method Details
-
createKey
-
register
private static VillagerProfession register(Registry<VillagerProfession> registry, ResourceKey<VillagerProfession> name, ResourceKey<PoiType> jobSite, @Nullable SoundEvent workSound, it.unimi.dsi.fastutil.ints.Int2ObjectMap<ResourceKey<TradeSet>> trades) -
register
private static VillagerProfession register(Registry<VillagerProfession> registry, ResourceKey<VillagerProfession> name, Predicate<Holder<PoiType>> heldJobSite, Predicate<Holder<PoiType>> acquirableJobSite, @Nullable SoundEvent workSound) -
register
private static VillagerProfession register(Registry<VillagerProfession> registry, ResourceKey<VillagerProfession> name, Predicate<Holder<PoiType>> heldJobSite, Predicate<Holder<PoiType>> acquirableJobSite, @Nullable SoundEvent workSound, it.unimi.dsi.fastutil.ints.Int2ObjectMap<ResourceKey<TradeSet>> trades) -
register
private static VillagerProfession register(Registry<VillagerProfession> registry, ResourceKey<VillagerProfession> name, ResourceKey<PoiType> jobSite, ImmutableSet<Item> requestedItems, ImmutableSet<Block> secondaryPoi, @Nullable SoundEvent workSound, it.unimi.dsi.fastutil.ints.Int2ObjectMap<ResourceKey<TradeSet>> trades) -
register
private static VillagerProfession register(Registry<VillagerProfession> registry, ResourceKey<VillagerProfession> name, Predicate<Holder<PoiType>> heldJobSite, Predicate<Holder<PoiType>> acquirableJobSite, ImmutableSet<Item> requestedItems, ImmutableSet<Block> secondaryPoi, @Nullable SoundEvent workSound, it.unimi.dsi.fastutil.ints.Int2ObjectMap<ResourceKey<TradeSet>> trades) -
bootstrap
-
getTrades
-
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). -
name
Returns the value of thenamerecord component.- Returns:
- the value of the
namerecord component
-
heldJobSite
-
acquirableJobSite
-
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
-
tradeSetsByLevel
Returns the value of thetradeSetsByLevelrecord component.- Returns:
- the value of the
tradeSetsByLevelrecord component
-