Fixed strange behavior when using storage buses with vanilla furnaces.

This commit is contained in:
AlgorithmX2 2014-08-01 00:44:44 -05:00
parent 1c266fc91a
commit 12838c6b7a

View file

@ -150,11 +150,33 @@ public class PartStorageBus extends PartUpgradeable implements IGridTickable, IC
return super.getInventoryByName( name );
}
private byte resetCacheLogic = 0;
private void resetCache(boolean fullReset)
{
if ( host == null || host.getTile() == null || host.getTile().getWorldObj() == null || host.getTile().getWorldObj().isRemote )
return;
if ( fullReset )
resetCacheLogic = 2;
else
resetCacheLogic = 1;
try
{
proxy.getTick().alertDevice( proxy.getNode() );
}
catch (GridAccessException e)
{
// :P
}
}
private void resetCache()
{
boolean fullReset = resetCacheLogic == 2;
resetCacheLogic = 0;
IMEInventory<IAEItemStack> in = getInternalHandler();
IItemList<IAEItemStack> before = AEApi.instance().storage().createItemList();
if ( in != null )
@ -368,12 +390,15 @@ public class PartStorageBus extends PartUpgradeable implements IGridTickable, IC
@Override
public TickingRequest getTickingRequest(IGridNode node)
{
return new TickingRequest( TickRates.StorageBus.min, TickRates.StorageBus.max, monitor == null, false );
return new TickingRequest( TickRates.StorageBus.min, TickRates.StorageBus.max, monitor == null, true );
}
@Override
public TickRateModulation tickingRequest(IGridNode node, int TicksSinceLastCall)
{
if ( resetCacheLogic != 0 )
resetCache();
if ( monitor != null )
return monitor.onTick();