Fix Interface Crash caused by negative items.
This commit is contained in:
@@ -156,6 +156,12 @@ public class DualityInterface implements IGridTickable, ISegmentedInventory, ISt
|
|||||||
private void updatePlan(int slot)
|
private void updatePlan(int slot)
|
||||||
{
|
{
|
||||||
IAEItemStack req = config.getAEStackInSlot( slot );
|
IAEItemStack req = config.getAEStackInSlot( slot );
|
||||||
|
if ( req != null && req.getStackSize() <= 0 )
|
||||||
|
{
|
||||||
|
config.setInventorySlotContents(slot, null);
|
||||||
|
req = null;
|
||||||
|
}
|
||||||
|
|
||||||
ItemStack Stored = storage.getStackInSlot( slot );
|
ItemStack Stored = storage.getStackInSlot( slot );
|
||||||
|
|
||||||
if ( req == null && Stored != null )
|
if ( req == null && Stored != null )
|
||||||
@@ -242,7 +248,7 @@ public class DualityInterface implements IGridTickable, ISegmentedInventory, ISt
|
|||||||
changed = true;
|
changed = true;
|
||||||
ItemStack issue = adaptor.addItems( aquired.getItemStack() );
|
ItemStack issue = adaptor.addItems( aquired.getItemStack() );
|
||||||
if ( issue != null )
|
if ( issue != null )
|
||||||
throw new RuntimeException( "bad attempt at managining inventory. ( addItems )" );
|
throw new RuntimeException( "bad attempt at managing inventory. ( addItems )" );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if ( itemStack.getStackSize() < 0 )
|
else if ( itemStack.getStackSize() < 0 )
|
||||||
@@ -263,9 +269,9 @@ public class DualityInterface implements IGridTickable, ISegmentedInventory, ISt
|
|||||||
changed = true;
|
changed = true;
|
||||||
ItemStack removed = adaptor.removeItems( (int) diff, null, null );
|
ItemStack removed = adaptor.removeItems( (int) diff, null, null );
|
||||||
if ( removed == null )
|
if ( removed == null )
|
||||||
throw new RuntimeException( "bad attempt at managining inventory. ( addItems )" );
|
throw new RuntimeException( "bad attempt at managing inventory. ( addItems )" );
|
||||||
else if ( removed.stackSize != diff )
|
else if ( removed.stackSize != diff )
|
||||||
throw new RuntimeException( "bad attempt at managining inventory. ( addItems )" );
|
throw new RuntimeException( "bad attempt at managing inventory. ( addItems )" );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// else wtf?
|
// else wtf?
|
||||||
|
|||||||
@@ -15,7 +15,6 @@ import org.lwjgl.opengl.GL11;
|
|||||||
|
|
||||||
import appeng.api.AEApi;
|
import appeng.api.AEApi;
|
||||||
import appeng.api.exceptions.FailedConnection;
|
import appeng.api.exceptions.FailedConnection;
|
||||||
import appeng.api.networking.GridFlags;
|
|
||||||
import appeng.api.networking.IGridConnection;
|
import appeng.api.networking.IGridConnection;
|
||||||
import appeng.api.networking.IGridNode;
|
import appeng.api.networking.IGridNode;
|
||||||
import appeng.api.parts.IPartCollsionHelper;
|
import appeng.api.parts.IPartCollsionHelper;
|
||||||
|
|||||||
Reference in New Issue
Block a user