TradeAPI
Trade with other players: offer items, accept and read both sides.
ClassRLPlugins API
public class TradeAPIMembers
Static methods
- voidaccept()
Accepts the trade.
- voiddecline()
Declines the trade.
- List<ItemEx>getOfferingItems()
The offering items.
- List<ItemEx>getReceivingItems()
The receiving items.
- booleanisAcceptedByOther()
Whether accepted by other.
- booleanisAcceptedByPlayer()
Whether accepted by player.
- booleanisOnConfirmationScreen()
Whether on confirmation screen.
- booleanisOnMainScreen()
Whether on main screen.
- booleanisOpen()
Whether open.
- voidoffer(ItemEx, int)
Offers an item from the inventory.
- voidoffer(String, int)
Offers an item with the given name and amount.
- voidoffer(int, int)
Offers an item with the given id and amount.
- voidremove(ItemEx, int)
Removes an offered item.
- voidremove(String, int)
Removes an item from the trade with the given name and amount.
- voidremove(int, int)
Removes an item from the trade with the given id and amount.
accept()static
public static void accept()Accepts the trade.
decline()static
public static void decline()Declines the trade.
getOfferingItems()static
public static List<ItemEx> getOfferingItems()The offering items.
Returns
Our items in trade.
getReceivingItems()static
public static List<ItemEx> getReceivingItems()The receiving items.
Returns
Other players items in trade.
isAcceptedByOther()static
public static boolean isAcceptedByOther()Whether accepted by other.
Returns
True if the other player has accepted the trade.
isAcceptedByPlayer()static
public static boolean isAcceptedByPlayer()Whether accepted by player.
Returns
True if we have accepted the trade.
isOnConfirmationScreen()static
public static boolean isOnConfirmationScreen()Whether on confirmation screen.
Returns
True is the second screen of the trade window is open.
isOnMainScreen()static
public static boolean isOnMainScreen()Whether on main screen.
Returns
True if the first screen of the trade window is open.
isOpen()static
public static boolean isOpen()Whether open.
Returns
True if the trade window is open.
offer(ItemEx, int)static
public static void offer(ItemEx item, int amount)Offers an item from the inventory.
Parameters
item- The item to offer.
amount- The amount to offer.
offer(String, int)static
public static void offer(String name, int amount)Offers an item with the given name and amount.
Parameters
name- The name to offer.
amount- The amount to offer.
offer(int, int)static
public static void offer(int id, int amount)Offers an item with the given id and amount.
Parameters
id- The item id.
amount- The item amount.
remove(ItemEx, int)static
public static void remove(ItemEx item, int amount)Removes an offered item.
Parameters
item- The item to remove.
amount- The amount to remove.
remove(String, int)static
public static void remove(String name, int amount)Removes an item from the trade with the given name and amount.
Parameters
name- The name to remove.
amount- The amount to remove.
remove(int, int)static
public static void remove(int id, int amount)Removes an item from the trade with the given id and amount.
Parameters
id- The id to remove.
amount- The amount to remove.
Also allowed
Every class has these, as in plain Java.
equals, toString