PvpArenaLoadoutAPI
PvP Arena build inventory and worn-equipment editor.
Final classRLPlugins API
public final class PvpArenaLoadoutAPIThe editor is client-script owned. Picker actions must pass through int, MenuAction, int, int, String, String) so the widget's on-op listener updates the selected build. Inventory-to-worn and discard operations must use a native mouse drag; a raw widget-drag packet skips the editor's drag-complete listener.
Constants
INVENTORY_SIZE, MAX_MED_BUILD, PURE_BUILD, ZERKER_BUILD
Members
Static methods
- booleanaddToInventory(int)
Adds one picker entry to the first free inventory slot using the listener-aware CC_OP path.
- booleancanSelectBuild(PvpArenaBuild)
Whether it can select build.
- intcountInventoryItem(int)
Counts an item in the active build inventory.
- booleandiscardFromInventory(int)
Human-drags an inventory item into the editor trash zone.
- booleanequipFromInventory(int, EquipmentSlot)
Human-drags an inventory item into its worn slot.
- intfindInventorySlot(int)
Find inventory slot.
- intgetActiveBuild()
The active build.
- PvpArenaBuildgetBuild()
The build.
- WidgetgetEquipmentDropTarget(EquipmentSlot)
Gets the live dynamic drop target inside an equipment slot.
- WidgetgetEquipmentItem(EquipmentSlot)
Gets the item widget inside an equipment slot.
- intgetEquipmentItemId(EquipmentSlot)
The equipment item id.
- WidgetgetEquipmentSlot(EquipmentSlot)
Gets the active build's equipment-slot drop target.
- intgetFreeInventorySlot()
The free inventory slot.
- intgetInventoryItemId(int)
The inventory item id.
- WidgetgetInventorySlot(int)
Gets one of the active build's 28 inventory slot widgets.
- PvpArenaSpellbookgetOpponentSpellbook()
Reads the opponent's selected spellbook from the unranked-duel screen.
- PvpArenaSpellbookgetSpellbook()
Reads the active build's spellbook.
- WidgetgetSupplyWidget(int)
Resolves the listener-bearing picker widget for an item.
- booleanisEmpty()
Whether empty.
- booleanisOpen()
Whether open.
- booleanisOpponentLoadoutTab()
Whether opponent loadout tab.
- booleanisOwnLoadoutTab()
Whether own loadout tab.
- booleanisWipeConfirmationOpen()
Whether wipe confirmation open.
- booleanmatches(PvpArenaLoadout)
Checks every worn slot, all 28 inventory slots, and the requested spellbook against an exact loadout.
- booleanmoveInventoryItem(int, int)
Human-drags one loadout inventory slot into another.
- voidopenOpponentLoadoutTab()
Opens the current opponent loadout with a real mouse click.
- voidopenOwnLoadoutTab()
Opens our loadout tab with a real mouse click.
- booleanselectBuild(PvpArenaBuild)
Selects a build with a real mouse click when the screen exposes its build controls.
- booleansetSpellbook(PvpArenaSpellbook)
Advances the client-owned spellbook selector.
- PvpArenaLoadoutSetupsetup(PvpArenaLoadout)
Creates a tick-owned exact setup session.
- PvpArenaOpponentLoadoutSetupsetupLikeOpponent()
Creates a tick-owned session that captures a stable visible opponent loadout, wipes ours, mirrors it, then rechecks both sides.
- PvpArenaLoadoutSnapshotsnapshot()
Captures our full loadout atomically on the client thread.
- PvpArenaLoadoutSnapshotsnapshotOpponent()
Captures the opponent only while its tab is open and visible.
- PvpArenaOpponentSpellbookSyncsyncSpellbookWithOpponent()
Creates a tick-owned session that captures two stable opponent spellbook readings, applies the same spellbook to our loadout, verifies both sides, and leaves the opponent tab visible.
- booleanunequipToInventory(EquipmentSlot, int)
Human-drags a worn item into an inventory slot.
- booleanwipe()
Advances the active build's two-step wipe flow.
addToInventory(int)static
public static boolean addToInventory(int itemId)Adds one picker entry to the first free inventory slot using the listener-aware CC_OP path.
For duplicate items, wait for countInventoryItem(int) to advance before dispatching the next Add.
Parameters
itemId- Item ID.
Returns
True when the action was dispatched.
canSelectBuild(PvpArenaBuild)static
public static boolean canSelectBuild(PvpArenaBuild build)Whether it can select build.
Parameters
build- Build.
Returns
True when the requested build can be selected on this screen.
countInventoryItem(int)static
public static int countInventoryItem(int itemId)Counts an item in the active build inventory.
Use this to confirm repeated picker additions. The editor can redraw duplicate items after the Add listener returns.
Parameters
itemId- Item ID.
Returns
Slot count, or 0 when the editor is closed.
discardFromInventory(int)static
public static boolean discardFromInventory(int inventorySlot)Human-drags an inventory item into the editor trash zone.
Parameters
inventorySlot- Inventory slot.
equipFromInventory(int, EquipmentSlot)static
public static boolean equipFromInventory(int inventorySlot, EquipmentSlot equipmentSlot)Human-drags an inventory item into its worn slot.
This only schedules the drag. The caller must wait for the shared mouse queue to finish and verify both source and destination before continuing.
Parameters
inventorySlot- Inventory slot.
equipmentSlot- Equipment slot.
findInventorySlot(int)static
public static int findInventorySlot(int itemId)Find inventory slot.
Parameters
itemId- Item id.
Returns
First inventory slot containing the item, or -1.
getActiveBuild()static
public static int getActiveBuild()The active build.
Returns
Active build index, or -1 when the editor is closed.
getBuild()static
public static PvpArenaBuild getBuild()The build.
getEquipmentDropTarget(EquipmentSlot)static
public static Widget getEquipmentDropTarget(EquipmentSlot slot)Gets the live dynamic drop target inside an equipment slot.
Parameters
slot- Equipment slot.
Returns
Dynamic target widget, or the static slot as a fallback.
getEquipmentItem(EquipmentSlot)static
public static Widget getEquipmentItem(EquipmentSlot slot)Gets the item widget inside an equipment slot.
Parameters
slot- Equipment slot.
Returns
Item widget, or null when empty.
getEquipmentItemId(EquipmentSlot)static
public static int getEquipmentItemId(EquipmentSlot slot)The equipment item id.
Parameters
slot- Slot.
getEquipmentSlot(EquipmentSlot)static
public static Widget getEquipmentSlot(EquipmentSlot slot)Gets the active build's equipment-slot drop target.
Parameters
slot- Equipment slot.
Returns
Slot widget, or null.
getFreeInventorySlot()static
public static int getFreeInventorySlot()The free inventory slot.
Returns
First empty inventory slot, or -1 when full/closed.
getInventoryItemId(int)static
public static int getInventoryItemId(int slot)The inventory item id.
Parameters
slot- Slot.
getInventorySlot(int)static
public static Widget getInventorySlot(int slot)Gets one of the active build's 28 inventory slot widgets.
Parameters
slot- Zero-based slot.
Returns
Live slot widget, or null.
getOpponentSpellbook()static
public static PvpArenaSpellbook getOpponentSpellbook()Reads the opponent's selected spellbook from the unranked-duel screen.
The opponent loadout tab must be open and visible. Hidden opponent widgets retain stale children after a change, so this method returns PvpArenaSpellbook.UNKNOWN instead of trusting hidden state.
getSpellbook()static
public static PvpArenaSpellbook getSpellbook()Reads the active build's spellbook.
getSupplyWidget(int)static
public static Widget getSupplyWidget(int itemId)Resolves the listener-bearing picker widget for an item.
The picker action widget carries item ID -1. Its item ID lives on a sibling icon widget at the same relative Y coordinate.
Parameters
itemId- Item ID to find.
Returns
Add action widget, or null.
isEmpty()static
public static boolean isEmpty()Whether empty.
Returns
True when the active build has no worn or inventory items.
isOpen()static
public static boolean isOpen()Whether open.
Returns
True when either supported PvP Arena build editor is visible.
isOpponentLoadoutTab()static
public static boolean isOpponentLoadoutTab()Whether opponent loadout tab.
Returns
True only while the current unranked-duel opponent tree is visible.
isOwnLoadoutTab()static
public static boolean isOwnLoadoutTab()Whether own loadout tab.
Returns
True when the supported duel screen is showing our loadout.
isWipeConfirmationOpen()static
public static boolean isWipeConfirmationOpen()Whether wipe confirmation open.
Returns
True when the editor's wipe confirmation is waiting.
matches(PvpArenaLoadout)static
public static boolean matches(PvpArenaLoadout loadout)Checks every worn slot, all 28 inventory slots, and the requested spellbook against an exact loadout.
Parameters
loadout- Loadout.
moveInventoryItem(int, int)static
public static boolean moveInventoryItem(int sourceSlot, int destinationSlot)Human-drags one loadout inventory slot into another.
Empty destination slots are supported and occupied destinations follow the client swap.
Parameters
sourceSlot- Source slot.
destinationSlot- Destination slot.
openOpponentLoadoutTab()static
public static void openOpponentLoadoutTab()Opens the current opponent loadout with a real mouse click.
openOwnLoadoutTab()static
public static void openOwnLoadoutTab()Opens our loadout tab with a real mouse click.
Does nothing unless a supported PvP Arena loadout screen is open.
selectBuild(PvpArenaBuild)static
public static boolean selectBuild(PvpArenaBuild build)Selects a build with a real mouse click when the screen exposes its build controls.
A locked unranked duel cannot be changed here.
Parameters
build- Build.
setSpellbook(PvpArenaSpellbook)static
public static boolean setSpellbook(PvpArenaSpellbook spellbook)Advances the client-owned spellbook selector.
If the menu is closed, this queues a real mouse click to open it. If it is open, this dispatches the matching listener-aware Select action. Tick-owned callers keep calling until getSpellbook() equals the requested spellbook.
Parameters
spellbook- Spellbook.
Returns
True when the requested state is already set or an action was queued.
setup(PvpArenaLoadout)static
public static PvpArenaLoadoutSetup setup(PvpArenaLoadout loadout)Creates a tick-owned exact setup session.
Pump it from ClientTick for fastest safe progress. It opens our loadout tab, wipes, equips worn items, fills inventory, selects the spellbook, then verifies the result.
Parameters
loadout- Loadout.
setupLikeOpponent()static
public static PvpArenaOpponentLoadoutSetup setupLikeOpponent()Creates a tick-owned session that captures a stable visible opponent loadout, wipes ours, mirrors it, then rechecks both sides.
snapshot()static
public static PvpArenaLoadoutSnapshot snapshot()Captures our full loadout atomically on the client thread.
snapshotOpponent()static
public static PvpArenaLoadoutSnapshot snapshotOpponent()Captures the opponent only while its tab is open and visible.
Hidden opponent widgets are deliberately rejected because they retain stale item children after a loadout changes.
syncSpellbookWithOpponent()static
public static PvpArenaOpponentSpellbookSync syncSpellbookWithOpponent()Creates a tick-owned session that captures two stable opponent spellbook readings, applies the same spellbook to our loadout, verifies both sides, and leaves the opponent tab visible.
unequipToInventory(EquipmentSlot, int)static
public static boolean unequipToInventory(EquipmentSlot equipmentSlot, int inventorySlot)Human-drags a worn item into an inventory slot.
Parameters
equipmentSlot- Equipment slot.
inventorySlot- Inventory slot.
wipe()static
public static boolean wipe()Advances the active build's two-step wipe flow.
The first call opens the PvP Arena confirmation popup. A later call confirms its green Wipe button. Tick-owned callers should keep calling this while the editor still contains items.
Also allowed
Every class has these, as in plain Java.
equals, toString