Prevent null Items?
This commit is contained in:
parent
a3091741ff
commit
2d12ffc304
2 changed files with 9 additions and 9 deletions
|
@ -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;
|
||||
|
@ -117,8 +118,9 @@ 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() ) );
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue