Improved Blocking Behavior for interfaces with inventories on multiple sides.
AE now ignores inventories that have no sizes this will improve a few strange behaviors.
This commit is contained in:
@@ -740,6 +740,8 @@ public class DualityInterface implements IGridTickable, ISegmentedInventory, ISt
|
|||||||
TileEntity tile = iHost.getTileEntity();
|
TileEntity tile = iHost.getTileEntity();
|
||||||
World w = tile.getWorldObj();
|
World w = tile.getWorldObj();
|
||||||
|
|
||||||
|
boolean allAreBusy=true;
|
||||||
|
|
||||||
for (ForgeDirection s : possibleDirections)
|
for (ForgeDirection s : possibleDirections)
|
||||||
{
|
{
|
||||||
TileEntity te = w.getTileEntity( tile.xCoord + s.offsetX, tile.yCoord + s.offsetY, tile.zCoord + s.offsetZ );
|
TileEntity te = w.getTileEntity( tile.xCoord + s.offsetX, tile.yCoord + s.offsetY, tile.zCoord + s.offsetZ );
|
||||||
@@ -747,13 +749,15 @@ public class DualityInterface implements IGridTickable, ISegmentedInventory, ISt
|
|||||||
InventoryAdaptor ad = InventoryAdaptor.getAdaptor( te, s.getOpposite() );
|
InventoryAdaptor ad = InventoryAdaptor.getAdaptor( te, s.getOpposite() );
|
||||||
if ( ad != null )
|
if ( ad != null )
|
||||||
{
|
{
|
||||||
if ( ad.simulateRemove( 1, null, null ) != null )
|
if ( ad.simulateRemove( 1, null, null ) == null )
|
||||||
{
|
{
|
||||||
busy = true;
|
allAreBusy = false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
busy = allAreBusy;
|
||||||
}
|
}
|
||||||
|
|
||||||
return busy;
|
return busy;
|
||||||
@@ -804,6 +808,12 @@ public class DualityInterface implements IGridTickable, ISegmentedInventory, ISt
|
|||||||
InventoryAdaptor ad = InventoryAdaptor.getAdaptor( te, s.getOpposite() );
|
InventoryAdaptor ad = InventoryAdaptor.getAdaptor( te, s.getOpposite() );
|
||||||
if ( ad != null )
|
if ( ad != null )
|
||||||
{
|
{
|
||||||
|
if ( isBlocking() )
|
||||||
|
{
|
||||||
|
if ( ad.simulateRemove( 1, null, null ) != null )
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if ( acceptsItems( ad, table ) )
|
if ( acceptsItems( ad, table ) )
|
||||||
{
|
{
|
||||||
for (int x = 0; x < table.getSizeInventory(); x++)
|
for (int x = 0; x < table.getSizeInventory(); x++)
|
||||||
|
|||||||
@@ -65,11 +65,16 @@ public abstract class InventoryAdaptor implements Iterable<ItemSlot>
|
|||||||
}
|
}
|
||||||
else if ( te instanceof ISidedInventory )
|
else if ( te instanceof ISidedInventory )
|
||||||
{
|
{
|
||||||
return new AdaptorIInventory( new WrapperMCISidedInventory( (ISidedInventory) te, d ) );
|
ISidedInventory si =(ISidedInventory)te;
|
||||||
|
int[] slots = si.getAccessibleSlotsFromSide( d.ordinal() );
|
||||||
|
if ( si.getSizeInventory() > 0 && slots != null && slots.length > 0 )
|
||||||
|
return new AdaptorIInventory( new WrapperMCISidedInventory( si, d ) );
|
||||||
}
|
}
|
||||||
else if ( te instanceof IInventory )
|
else if ( te instanceof IInventory )
|
||||||
{
|
{
|
||||||
return new AdaptorIInventory( (IInventory) te );
|
IInventory i =(IInventory)te;
|
||||||
|
if ( i.getSizeInventory() > 0 )
|
||||||
|
return new AdaptorIInventory( i );
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
Reference in New Issue
Block a user