Class TradeSlot

java.lang.Object
com.hypixel.hytale.builtin.adventure.shop.barter.TradeSlot
Direct Known Subclasses:
FixedTradeSlot, PoolTradeSlot

public abstract class TradeSlot extends Object
Base class for trade slot definitions. Trade slots define how trades are selected for display in a shop.

Types: - Fixed: Always shows a specific trade - Pool: Randomly selects trades from a weighted pool

  • Field Details

    • CODEC

      @Nonnull public static final CodecMapCodec<TradeSlot> CODEC
      Polymorphic codec using "Type" field as discriminator.
    • EMPTY_ARRAY

      @Nonnull public static final TradeSlot[] EMPTY_ARRAY
  • Method Details

    • resolve

      @Nonnull public abstract List<BarterTrade> resolve(@Nonnull Random random)
      Resolve this slot into concrete trades.
      Parameters:
      random - Random source for weighted selection
      Returns:
      List of resolved BarterTrade instances
    • getSlotCount

      public abstract int getSlotCount()
      Get the number of trade slots this definition will produce.
      Returns:
      Number of trades this slot will resolve to