Record Class LootTable

java.lang.Object
java.lang.Record
com.github.darksoulq.abyssallib.world.data.loot.LootTable
Record Components:
pools - The internal collection of configured loot pools dictating sequential evaluation phases.
mergeStrategy - The targeted configuration strategy resolving potential overlap when mirroring vanilla namespace identities.
vanillaId - The optional designated string identifier establishing native parity overrides.

public record LootTable(List<LootPool> pools, MergeStrategy mergeStrategy, String vanillaId) extends Record
Represents a complete loot table capable of synthesizing item collections and intelligently populating external containers using context-driven probability logic.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final Codec<LootTable>
    The codec managing the serialization conversion linking active memory representations to storage payloads.
  • Constructor Summary

    Constructors
    Constructor
    Description
    LootTable(List<LootPool> pools, MergeStrategy mergeStrategy, String vanillaId)
    Constructs a new LootTable incorporating probability pools and structural overrides.
  • Method Summary

    Modifier and Type
    Method
    Description
    final boolean
    Indicates whether some other object is "equal to" this one.
    void
    fill(org.bukkit.inventory.Inventory inventory, LootContext context)
    Generates and distributes physical loot dynamically across a target inventory, strictly adhering to mathematical slot availability thresholds.
    List<org.bukkit.inventory.ItemStack>
    Evaluates probabilistic algorithms to materialize a discrete list of items.
    final int
    Returns a hash code value for this object.
    Retrieves the conflict resolution strategy bridging procedural and structural overlaps.
    Retrieves the internal collection of configured loot pools dictating sequential evaluation phases.
    final String
    Returns a string representation of this record class.
    Retrieves the linked internal namespace key utilized by vanilla parity overlays.

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • CODEC

      public static final Codec<LootTable> CODEC
      The codec managing the serialization conversion linking active memory representations to storage payloads.
  • Constructor Details

    • LootTable

      public LootTable(List<LootPool> pools, MergeStrategy mergeStrategy, @Nullable String vanillaId)
      Constructs a new LootTable incorporating probability pools and structural overrides.
      Parameters:
      pools - The collection of functional pools generating drops.
      mergeStrategy - The conflict resolution strategy mapped against vanilla identifiers.
      vanillaId - The targeted namespace mapping dictating override bounds.
  • Method Details

    • pools

      public List<LootPool> pools()
      Retrieves the internal collection of configured loot pools dictating sequential evaluation phases.
      Returns:
      The list of functional pools generating drops.
    • generate

      public List<org.bukkit.inventory.ItemStack> generate(LootContext context)
      Evaluates probabilistic algorithms to materialize a discrete list of items.
      Parameters:
      context - The functional environment encompassing actors and mathematical modifiers.
      Returns:
      A list of items synthesized across all constituent pools.
    • fill

      public void fill(org.bukkit.inventory.Inventory inventory, LootContext context)
      Generates and distributes physical loot dynamically across a target inventory, strictly adhering to mathematical slot availability thresholds.
      Parameters:
      inventory - The operational inventory target receiving the synthesized payload.
      context - The functional environment governing generation variables.
    • mergeStrategy

      public MergeStrategy mergeStrategy()
      Retrieves the conflict resolution strategy bridging procedural and structural overlaps.
      Returns:
      The operational merge strategy configuration.
    • vanillaId

      @Nullable public String vanillaId()
      Retrieves the linked internal namespace key utilized by vanilla parity overlays.
      Returns:
      The targeted string identifier, or null.
    • 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.