java.lang.Object
Kyu.GuiAPI_Redone.Window.WindowImpl.TradeWindow.TradeItems

public class TradeItems extends Object
  • Constructor Details

    • TradeItems

      public TradeItems(TradeWindowHolder parentWindow, org.bukkit.entity.Player mainParty)
      Handles the items of the trade
      Parameters:
      parentWindow - TradeWindowHolder parent of the windows
      mainParty - the initiator of the trade
  • Method Details

    • addItem

      public void addItem(org.bukkit.inventory.ItemStack item, TradeWindow window, org.bukkit.entity.Player p)
      Adds an item to the trade, should go through the TradeWindowHolder.addTradeItem(Player, ItemStack) though
      Parameters:
      item - item to add
      window - window to check for open slots
      p - the player the item belongs to
    • removeItem

      public void removeItem(GuiItem item, org.bukkit.entity.Player p)
      Removes an item from the trade. Should go through the TradeWindowHolder.removeTradeItem(Player, GuiItem) route though
      Parameters:
      item - Item to remove
      p - Player it belongs to
    • getOwnItems

      public List<GuiItem> getOwnItems(org.bukkit.entity.Player p)
      Gets the items the provided player has added to the trade
      Parameters:
      p - player to get items from
      Returns:
      items the provided player has added to the trade
    • getOtherItems

      public List<GuiItem> getOtherItems(org.bukkit.entity.Player p)
      Gets the items the other party has added to the trade
      Parameters:
      p - player you don't want the items from
      Returns:
      items the other party has added to the trade
    • clear

      public void clear()
      Clears all trade items (does not refresh the windows as this is intended for post-trade cleanup)