Fixed grindstone not working with crank due to missed null checks.

This commit is contained in:
Gunther De Wachter
2017-06-27 17:20:13 +02:00
parent 99c294e948
commit 66a797dd7c
@@ -97,13 +97,13 @@ public class TileGrinder extends AEBaseInvTile implements ICrankable
return false; return false;
} }
if( null == this.getStackInSlot( 6 ) ) // Add if there isn't one... if( this.getStackInSlot( 6 ).isEmpty() ) // Add if there isn't one...
{ {
final IInventory src = new WrapperInventoryRange( this, this.inputs, true ); final IInventory src = new WrapperInventoryRange( this, this.inputs, true );
for( int x = 0; x < src.getSizeInventory(); x++ ) for( int x = 0; x < src.getSizeInventory(); x++ )
{ {
ItemStack item = src.getStackInSlot( x ); ItemStack item = src.getStackInSlot( x );
if( item == null ) if( item.isEmpty() )
{ {
continue; continue;
} }
@@ -119,7 +119,7 @@ public class TileGrinder extends AEBaseInvTile implements ICrankable
if( item.getCount() <= 0 ) if( item.getCount() <= 0 )
{ {
item = null; item = ItemStack.EMPTY;
} }
src.setInventorySlotContents( x, item ); src.setInventorySlotContents( x, item );
@@ -183,7 +183,7 @@ public class TileGrinder extends AEBaseInvTile implements ICrankable
private void addItem( final InventoryAdaptor sia, final ItemStack output ) private void addItem( final InventoryAdaptor sia, final ItemStack output )
{ {
if( output == null ) if( output.isEmpty() )
{ {
return; return;
} }