Package net.glowstone.inventory
Class DragTracker
java.lang.Object
net.glowstone.inventory.DragTracker
Tracker for the item-drag operations a player is performing.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
addSlot
(boolean right, int slot) Add a slot to an in-progress drag operation if possible.finish
(boolean right) Finish an in-progress drag operation if possible.void
reset()
Reset back to the default state (no drag in progress).boolean
start
(boolean right) Start tracking a drag operation if possible.
-
Constructor Details
-
DragTracker
public DragTracker()
-
-
Method Details
-
start
public boolean start(boolean right) Start tracking a drag operation if possible.- Parameters:
right
- True if the drag is a right-click drag.- Returns:
- True if the drag start was accepted.
-
addSlot
public boolean addSlot(boolean right, int slot) Add a slot to an in-progress drag operation if possible.- Parameters:
right
- True if the drag is a right-click drag.slot
- The slot to add to the drag operation.- Returns:
- True if the slot was accepted.
-
finish
Finish an in-progress drag operation if possible.- Parameters:
right
- True if the drag is a right-click drag.- Returns:
- The list of slots involved in the drag, or null on failure.
-
reset
public void reset()Reset back to the default state (no drag in progress).
-