Class DragTracker

java.lang.Object
net.glowstone.inventory.DragTracker

public final class DragTracker extends Object
Tracker for the item-drag operations a player is performing.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    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 back to the default state (no drag in progress).
    boolean
    start(boolean right)
    Start tracking a drag operation if possible.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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

      public List<Integer> finish(boolean right)
      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).