Class FixedTradeSlot

java.lang.Object
com.hypixel.hytale.builtin.adventure.shop.barter.TradeSlot
com.hypixel.hytale.builtin.adventure.shop.barter.FixedTradeSlot

public class FixedTradeSlot extends TradeSlot
A trade slot that always shows a specific trade.

JSON format:

{
  "Type": "Fixed",
  "Trade": {
    "Output": { "ItemId": "...", "Quantity": 1 },
    "Input": [{ "ItemId": "...", "Quantity": 1 }],
    "Stock": 10
  }
}
  • Field Details

  • Constructor Details

    • FixedTradeSlot

      public FixedTradeSlot(@Nonnull BarterTrade trade)
  • Method Details

    • getTrade

      @Nonnull public BarterTrade getTrade()
    • resolve

      @Nonnull public List<BarterTrade> resolve(@Nonnull Random random)
      Description copied from class: TradeSlot
      Resolve this slot into concrete trades.
      Specified by:
      resolve in class TradeSlot
      Parameters:
      random - Random source for weighted selection
      Returns:
      List of resolved BarterTrade instances
    • getSlotCount

      public int getSlotCount()
      Description copied from class: TradeSlot
      Get the number of trade slots this definition will produce.
      Specified by:
      getSlotCount in class TradeSlot
      Returns:
      Number of trades this slot will resolve to
    • toString

      @Nonnull public String toString()
      Overrides:
      toString in class Object