Record Class VillagerProfession

java.lang.Object
java.lang.Record
net.minecraft.world.entity.npc.VillagerProfession

public record 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) extends Record
  • Field Details

  • 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 a VillagerProfession record class.
      Parameters:
      name - the value for the name record component
      heldJobSite - the value for the heldJobSite record component
      acquirableJobSite - the value for the acquirableJobSite record component
      requestedItems - the value for the requestedItems record component
      secondaryPoi - the value for the secondaryPoi record component
      workSound - the value for the workSound record component
  • Method Details

    • toString

      public String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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

      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_, @Nullable SoundEvent p_219664_)
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • name

      public String name()
      Returns the value of the name record component.
      Returns:
      the value of the name record component
    • heldJobSite

      public Predicate<Holder<PoiType>> heldJobSite()
      Returns the value of the heldJobSite record component.
      Returns:
      the value of the heldJobSite record component
    • acquirableJobSite

      public Predicate<Holder<PoiType>> acquirableJobSite()
      Returns the value of the acquirableJobSite record component.
      Returns:
      the value of the acquirableJobSite record component
    • requestedItems

      public com.google.common.collect.ImmutableSet<Item> requestedItems()
      Returns the value of the requestedItems record component.
      Returns:
      the value of the requestedItems record component
    • secondaryPoi

      public com.google.common.collect.ImmutableSet<Block> secondaryPoi()
      Returns the value of the secondaryPoi record component.
      Returns:
      the value of the secondaryPoi record component
    • workSound

      @Nullable public SoundEvent workSound()
      Returns the value of the workSound record component.
      Returns:
      the value of the workSound record component