allow interface itemstack handler to accept over sized stacks

This commit is contained in:
PrototypeTrousers
2022-10-12 17:40:25 -03:00
parent 2e9a5dc8ea
commit 4bac5f43db
9 changed files with 124 additions and 16 deletions
+16 -2
View File
@@ -191,6 +191,14 @@ public abstract class AEBaseGui extends GuiContainer implements IMTModGuiContain
GlStateManager.disableDepth();
}
@Nonnull
@Override
public List<String> getItemToolTip(@Nonnull ItemStack itemStack) {
List<String> l = super.getItemToolTip(itemStack);
l.add(1, TextFormatting.GRAY + String.valueOf(itemStack.getCount()));
return l;
}
public List<Rectangle> getJEIExclusionArea() {
return Collections.emptyList();
}
@@ -723,8 +731,14 @@ public abstract class AEBaseGui extends GuiContainer implements IMTModGuiContain
if (slot instanceof SlotFake) {
final ItemStack stack = slot.getStack();
if (stack != ItemStack.EMPTY) {
InventoryAction direction = wheel > 0 ? InventoryAction.PLACE_SINGLE : InventoryAction.PICKUP_SINGLE;
final PacketInventoryAction p = new PacketInventoryAction(direction, slot.slotNumber, 0);
final PacketInventoryAction p;
if (Keyboard.isKeyDown(Keyboard.KEY_LCONTROL) || Keyboard.isKeyDown(Keyboard.KEY_RCONTROL)) {
InventoryAction direction = wheel > 0 ? InventoryAction.DOUBLE : InventoryAction.HALVE;
p = new PacketInventoryAction(direction, slot.slotNumber, 0);
} else {
InventoryAction direction = wheel > 0 ? InventoryAction.PLACE_SINGLE : InventoryAction.PICKUP_SINGLE;
p = new PacketInventoryAction(direction, slot.slotNumber, 0);
}
NetworkHandler.instance().sendToServer(p);
}
}