use of com.enderio.core.client.gui.widget.GhostSlot in project EnderIO by SleepyTrousers.
the class GuiInventoryPanel method mouseWheel.
@Override
protected void mouseWheel(int x, int y, int delta) {
super.mouseWheel(x, y, delta);
if (draggingScrollbar == null) {
x -= guiLeft;
y -= guiTop;
boolean shift = isShiftKeyDown();
if (inventoryArea.contains(x, y)) {
GhostSlot hovered = getGhostSlotHandler().getGhostSlotAt(this, x, y);
if (!shift) {
scrollbar.scrollBy(-Integer.signum(delta));
} else if (hovered instanceof InvSlot) {
InvSlot invSlot = (InvSlot) hovered;
InventoryDatabaseClient db = getDatabase();
if (invSlot.getStack() != null && invSlot.entry != null && db != null) {
ItemStack itemStack = mc.player.inventory.getItemStack();
if (itemStack.isEmpty() || ItemUtil.areStackMergable(itemStack, invSlot.getStack())) {
PacketHandler.INSTANCE.sendToServer(new PacketFetchItem(db.getGeneration(), invSlot.entry, -1, 1));
}
}
}
}
}
}
Aggregations