Record Class Treasure

java.lang.Object
java.lang.Record
com.wdiscute.starcatcher.fish.Treasure

public record Treasure(List<WeightedLootTable> lootTables, List<WeightedStack> stacks, List<net.minecraft.world.item.crafting.Ingredient> blacklist) extends Record
  • Field Details

    • EMPTY

      public static final Treasure EMPTY
    • VANILLA_FISHING_LOOT_TABLE

      public static final Treasure VANILLA_FISHING_LOOT_TABLE
    • EXAMPLE_TREASURE

      public static final Treasure EXAMPLE_TREASURE
    • AZURE_CRYSTAL_SKIN_SMITHING_TEMPLATE

      public static final Treasure AZURE_CRYSTAL_SKIN_SMITHING_TEMPLATE
    • KIMBE_SMITHING_TEMPLATE

      public static final Treasure KIMBE_SMITHING_TEMPLATE
    • COLORFUL_SMITHING_TEMPLATE

      public static final Treasure COLORFUL_SMITHING_TEMPLATE
    • CLEAR_SMITHING_TEMPLATE

      public static final Treasure CLEAR_SMITHING_TEMPLATE
    • KING_SMITHING_TEMPLATE

      public static final Treasure KING_SMITHING_TEMPLATE
    • ICEBORN_SKIN_SMITHING_TEMPLATE

      public static final Treasure ICEBORN_SKIN_SMITHING_TEMPLATE
    • SKY_SKIN_SMITHING_TEMPLATE

      public static final Treasure SKY_SKIN_SMITHING_TEMPLATE
    • SHARK_SKIN_SMITHING_TEMPLATE

      public static final Treasure SHARK_SKIN_SMITHING_TEMPLATE
    • LUSH_SKIN_SMITHING_TEMPLATE

      public static final Treasure LUSH_SKIN_SMITHING_TEMPLATE
    • CODEC

      public static final com.mojang.serialization.Codec<Treasure> CODEC
    • STREAM_CODEC

      public static final net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf,Treasure> STREAM_CODEC
  • Constructor Details

    • Treasure

      public Treasure(List<WeightedLootTable> lootTables, List<WeightedStack> stacks, List<net.minecraft.world.item.crafting.Ingredient> blacklist)
      Creates an instance of a Treasure record class.
      Parameters:
      lootTables - the value for the lootTables record component
      stacks - the value for the stacks record component
      blacklist - the value for the blacklist record component
  • Method Details

    • lootTable

      public static Treasure lootTable(List<net.minecraft.resources.ResourceLocation> lootTables, net.minecraft.world.item.Item... blacklist)
    • specificItem

      public static Treasure specificItem(net.minecraft.world.item.ItemStack itemStack)
    • unpack

      public net.minecraft.world.item.ItemStack unpack(net.minecraft.server.level.ServerPlayer player, List<AbstractCatchModifier> modifiers)
    • toString

      public final 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
    • 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.
    • lootTables

      public List<WeightedLootTable> lootTables()
      Returns the value of the lootTables record component.
      Returns:
      the value of the lootTables record component
    • stacks

      public List<WeightedStack> stacks()
      Returns the value of the stacks record component.
      Returns:
      the value of the stacks record component
    • blacklist

      public List<net.minecraft.world.item.crafting.Ingredient> blacklist()
      Returns the value of the blacklist record component.
      Returns:
      the value of the blacklist record component