From f316c93e380112d1ea1c486b761ab900c110626f Mon Sep 17 00:00:00 2001 From: Sebastian Hartte Date: Sun, 2 Oct 2016 21:30:13 +0200 Subject: [PATCH] Fixes #2403: Force stack size to 1 for removing the stack size display in the crafting amount window. --- .../appeng/client/gui/implementations/GuiCraftAmount.java | 2 +- .../appeng/core/sync/packets/PacketInventoryAction.java | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/main/java/appeng/client/gui/implementations/GuiCraftAmount.java b/src/main/java/appeng/client/gui/implementations/GuiCraftAmount.java index d44a7039a..a67d80a0c 100644 --- a/src/main/java/appeng/client/gui/implementations/GuiCraftAmount.java +++ b/src/main/java/appeng/client/gui/implementations/GuiCraftAmount.java @@ -154,7 +154,7 @@ public class GuiCraftAmount extends AEBaseGui try { Long.parseLong( this.amountToCraft.getText() ); - this.next.enabled = this.amountToCraft.getText().length() > 0; + this.next.enabled = !this.amountToCraft.getText().isEmpty(); } catch( final NumberFormatException e ) { diff --git a/src/main/java/appeng/core/sync/packets/PacketInventoryAction.java b/src/main/java/appeng/core/sync/packets/PacketInventoryAction.java index 4f8a206ff..f0ff52927 100644 --- a/src/main/java/appeng/core/sync/packets/PacketInventoryAction.java +++ b/src/main/java/appeng/core/sync/packets/PacketInventoryAction.java @@ -26,6 +26,7 @@ import io.netty.buffer.Unpooled; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import appeng.api.storage.data.IAEItemStack; @@ -140,7 +141,11 @@ public class PacketInventoryAction extends AppEngPacket if( baseContainer.getTargetStack() != null ) { - cca.getCraftingItem().putStack( baseContainer.getTargetStack().getItemStack() ); + // Force to stack size 1 to fix a client-side display problem... + ItemStack displayIs = baseContainer.getTargetStack().getItemStack().copy(); + displayIs.stackSize = 1; + cca.getCraftingItem().putStack( displayIs ); + // This is the *actual* item that matters, not the display item above cca.setItemToCraft( baseContainer.getTargetStack() ); }