use of gregtech.api.util.ItemStackKey in project GregTech by GregTechCE.
the class ItemListSlotWidget method handleClientAction.
@Override
public void handleClientAction(int id, PacketBuffer buffer) {
super.handleClientAction(id, buffer);
if (id == 1) {
try {
ItemStack itemStack = buffer.readItemStack();
int button = buffer.readVarInt();
IItemInfo itemInfo = itemStack.isEmpty() ? null : gridWidget.getItemList().getItemInfo(new ItemStackKey(itemStack));
handleMouseClick(itemInfo, button, false);
} catch (IOException e) {
throw new RuntimeException(e);
}
} else if (id == 2) {
try {
ItemStack itemStack = buffer.readItemStack();
IItemInfo itemInfo = gridWidget.getItemList().getItemInfo(new ItemStackKey(itemStack));
if (itemInfo != null) {
handleSelfShiftClick(itemInfo);
}
} catch (IOException e) {
throw new RuntimeException(e);
}
}
}
Aggregations