Search in sources :

Example 1 with IGuiSlot

use of buildcraft.api.statements.IGuiSlot in project BuildCraft by BuildCraft.

the class GuiElementStatementDrag method onMouseClicked.

// IInteractableElement
@Override
public void onMouseClicked(int button) {
    if (button != 1) {
        return;
    }
    for (IGuiElement element : gui.getElementsAt(gui.mouse.getX(), gui.mouse.getY())) {
        if (element instanceof IReference<?>) {
            IReference<?> ref = (IReference<?>) element;
            Object obj = ref.get();
            if (obj == null || obj instanceof IGuiSlot) {
                startDragging((IGuiSlot) obj);
                break;
            }
        }
    }
}
Also used : IGuiSlot(buildcraft.api.statements.IGuiSlot) IGuiElement(buildcraft.lib.gui.IGuiElement) IReference(buildcraft.lib.misc.data.IReference)

Aggregations

IGuiSlot (buildcraft.api.statements.IGuiSlot)1 IGuiElement (buildcraft.lib.gui.IGuiElement)1 IReference (buildcraft.lib.misc.data.IReference)1