Class TradeItems
java.lang.Object
Kyu.GuiAPI_Redone.Window.WindowImpl.TradeWindow.TradeItems
-
Constructor Summary
ConstructorsConstructorDescriptionTradeItems
(TradeWindowHolder parentWindow, org.bukkit.entity.Player mainParty) Handles the items of the trade -
Method Summary
Modifier and TypeMethodDescriptionvoid
addItem
(org.bukkit.inventory.ItemStack item, TradeWindow window, org.bukkit.entity.Player p) Adds an item to the trade, should go through theTradeWindowHolder.addTradeItem(Player, ItemStack)
thoughvoid
clear()
Clears all trade items (does not refresh the windows as this is intended for post-trade cleanup)getOtherItems
(org.bukkit.entity.Player p) Gets the items the other party has added to the tradegetOwnItems
(org.bukkit.entity.Player p) Gets the items the provided player has added to the tradevoid
removeItem
(GuiItem item, org.bukkit.entity.Player p) Removes an item from the trade.
-
Constructor Details
-
TradeItems
Handles the items of the trade- Parameters:
parentWindow
-TradeWindowHolder
parent of the windowsmainParty
- 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 theTradeWindowHolder.addTradeItem(Player, ItemStack)
though- Parameters:
item
- item to addwindow
- window to check for open slotsp
- the player the item belongs to
-
removeItem
Removes an item from the trade. Should go through theTradeWindowHolder.removeTradeItem(Player, GuiItem)
route though- Parameters:
item
- Item to removep
- Player it belongs to
-
getOwnItems
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
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)
-