diff --git a/client/gui/implementations/GuiCraftAmount.java b/client/gui/implementations/GuiCraftAmount.java index 4b432a34..8727bc83 100644 --- a/client/gui/implementations/GuiCraftAmount.java +++ b/client/gui/implementations/GuiCraftAmount.java @@ -7,6 +7,7 @@ import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; import appeng.api.AEApi; import appeng.api.storage.ITerminalHost; +import appeng.api.storage.data.IAEItemStack; import appeng.client.gui.AEBaseGui; import appeng.client.gui.widgets.GuiNumberBox; import appeng.client.gui.widgets.GuiTabButton; @@ -109,7 +110,7 @@ public class GuiCraftAmount extends AEBaseGui try { - + if ( btn == originalGuiBtn ) { NetworkHandler.instance.sendToServer( new PacketSwitchGuis( OriginalGui ) ); @@ -117,12 +118,13 @@ public class GuiCraftAmount extends AEBaseGui if ( btn == next ) { - NetworkHandler.instance.sendToServer( new PacketCraftRequest( inventorySlots.getSlot( 0 ).getStack(), Integer.parseInt( this.amountToCraft - .getText() ), isShiftKeyDown() ) ); + IAEItemStack what = AEApi.instance().storage().createItemStack( inventorySlots.getSlot( 0 ).getStack() ); + if ( what != null ) + NetworkHandler.instance.sendToServer( new PacketCraftRequest( what, Integer.parseInt( this.amountToCraft.getText() ), isShiftKeyDown() ) ); } } - catch(NumberFormatException e ) + catch (NumberFormatException e) { // nope.. amountToCraft.setText( "1" ); @@ -166,7 +168,7 @@ public class GuiCraftAmount extends AEBaseGui result += i; if ( result < 1 ) result = 1; - + Out = Long.toString( result ); Integer.parseInt( Out ); amountToCraft.setText( Out ); diff --git a/core/sync/packets/PacketCraftRequest.java b/core/sync/packets/PacketCraftRequest.java index a1c2d680..75f67b16 100644 --- a/core/sync/packets/PacketCraftRequest.java +++ b/core/sync/packets/PacketCraftRequest.java @@ -7,10 +7,8 @@ import java.io.IOException; import java.util.concurrent.Future; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraftforge.common.util.ForgeDirection; -import appeng.api.AEApi; import appeng.api.networking.IGrid; import appeng.api.networking.IGridHost; import appeng.api.networking.IGridNode; @@ -90,8 +88,8 @@ public class PacketCraftRequest extends AppEngPacket } } - public PacketCraftRequest(ItemStack stack, int parseInt, boolean shift) throws IOException { - this.slotItem = AEApi.instance().storage().createItemStack( stack ); + public PacketCraftRequest(IAEItemStack stack, int parseInt, boolean shift) throws IOException { + this.slotItem = stack; this.slotItem.setStackSize( parseInt ); this.heldShift = shift;