tweak cache reset on interface config

This commit is contained in:
PrototypeTrousers
2022-02-21 18:25:58 -03:00
parent 8846202270
commit ee9441474e
2 changed files with 520 additions and 496 deletions
@@ -304,17 +304,33 @@ public class PartStorageBus extends PartUpgradeable implements IGridTickable, IC
if( te instanceof TileCableBus ) if( te instanceof TileCableBus )
{ {
IPart iPart = ( (TileCableBus) te ).getPart( this.getSide().getOpposite() ); IPart iPart = ( (TileCableBus) te ).getPart( this.getSide().getOpposite() );
if( iPart == null || iPart instanceof PartInterface ) if( iPart == null )
{
this.resetCache( true );
this.resetCache();
}
else if( iPart instanceof PartInterface )
{
if( createHandlerHash( te ) != handlerHash )
{ {
this.resetCache( true ); this.resetCache( true );
this.resetCache(); this.resetCache();
} }
} }
else if( te == null || te instanceof TileInterface ) }
else if( te == null )
{ {
this.resetCache( true ); this.resetCache( true );
this.resetCache(); this.resetCache();
} }
else if( te instanceof TileInterface )
{
if( createHandlerHash( te ) != handlerHash )
{
this.resetCache( true );
this.resetCache();
}
}
else else
{ {
this.resetCache( false ); this.resetCache( false );
@@ -463,6 +479,15 @@ public class PartStorageBus extends PartUpgradeable implements IGridTickable, IC
if( target.hasCapability( Capabilities.STORAGE_MONITORABLE_ACCESSOR, targetSide ) ) if( target.hasCapability( Capabilities.STORAGE_MONITORABLE_ACCESSOR, targetSide ) )
{ {
IStorageMonitorableAccessor accessor = target.getCapability( Capabilities.STORAGE_MONITORABLE_ACCESSOR, targetSide );
if( accessor != null )
{
IStorageMonitorable inventory = accessor.getInventory( this.mySrc );
if( inventory != null )
{
return Objects.hash( target, inventory.getInventory( AEApi.instance().storage().getStorageChannel( IItemStorageChannel.class ) ) );
}
}
return Objects.hash( target, target.getCapability( Capabilities.STORAGE_MONITORABLE_ACCESSOR, targetSide ) ); return Objects.hash( target, target.getCapability( Capabilities.STORAGE_MONITORABLE_ACCESSOR, targetSide ) );
} }
@@ -576,7 +601,7 @@ public class PartStorageBus extends PartUpgradeable implements IGridTickable, IC
try try
{ {
// force grid to update handlers... // force grid to update handlers...
(( GridStorageCache ) this.getProxy().getGrid().getCache( IStorageGrid.class )).cellUpdate( null ); ( (GridStorageCache) this.getProxy().getGrid().getCache( IStorageGrid.class ) ).cellUpdate( null );
} }
catch( final GridAccessException e ) catch( final GridAccessException e )
{ {
@@ -214,7 +214,6 @@ public class TileMolecularAssembler extends AENetworkInvTile implements IUpgrade
if( pos.offset( updateFromFacing ).equals( neighbor ) ) if( pos.offset( updateFromFacing ).equals( neighbor ) )
{ {
TileEntity te = w.getTileEntity( neighbor ); TileEntity te = w.getTileEntity( neighbor );
Object capability = null; Object capability = null;
if( te != null ) if( te != null )