Fix an issue where interfaces would not cause storage buses to re-check their status.

This commit is contained in:
AlgorithmX2 2014-06-23 00:08:38 -05:00
parent d4619fd48e
commit f41c5793fe
3 changed files with 41 additions and 7 deletions

View file

@ -214,11 +214,7 @@ public class DualityInterface implements IGridTickable, ISegmentedInventory, ISt
}
}
TileEntity te = iHost.getTileEntity();
if ( hadConfig != hasConfig && te != null && te.getWorldObj() != null )
{
te.getWorldObj().notifyBlocksOfNeighborChange( te.xCoord, te.yCoord, te.zCoord, Platform.air );
}
notifyNeightbors();
}
public void writeToNBT(NBTTagCompound data)
@ -463,8 +459,7 @@ public class DualityInterface implements IGridTickable, ISegmentedInventory, ISt
fluids.setInternal( new NullInventory() );
}
TileEntity te = iHost.getTileEntity();
te.getWorldObj().notifyBlocksOfNeighborChange( te.xCoord, te.yCoord, te.zCoord, Platform.air );
notifyNeightbors();
}
public AECableType getCableConnectionType(ForgeDirection dir)
@ -802,4 +797,13 @@ public class DualityInterface implements IGridTickable, ISegmentedInventory, ISt
drops.add( is );
}
public void notifyNeightbors()
{
TileEntity te = iHost.getTileEntity();
if ( te != null && te.getWorldObj() != null )
{
te.getWorldObj().notifyBlocksOfNeighborChange( te.xCoord, te.yCoord, te.zCoord, Platform.air );
}
}
}

View file

@ -19,6 +19,9 @@ import appeng.api.implementations.tiles.ITileStorageMonitorable;
import appeng.api.networking.IGridNode;
import appeng.api.networking.crafting.ICraftingPatternDetails;
import appeng.api.networking.crafting.ICraftingProviderHelper;
import appeng.api.networking.events.MENetworkChannelsChanged;
import appeng.api.networking.events.MENetworkEventSubscribe;
import appeng.api.networking.events.MENetworkPowerStatusChange;
import appeng.api.networking.security.BaseActionSource;
import appeng.api.networking.ticking.IGridTickable;
import appeng.api.networking.ticking.TickRateModulation;
@ -52,6 +55,18 @@ public class PartInterface extends PartBasicState implements IGridTickable, ISeg
super( PartInterface.class, is );
}
@MENetworkEventSubscribe
public void stateChange(MENetworkChannelsChanged c)
{
duality.notifyNeightbors();
}
@MENetworkEventSubscribe
public void stateChange(MENetworkPowerStatusChange c)
{
duality.notifyNeightbors();
}
@Override
public void gridChanged()
{

View file

@ -15,6 +15,9 @@ import appeng.api.implementations.tiles.ITileStorageMonitorable;
import appeng.api.networking.IGridNode;
import appeng.api.networking.crafting.ICraftingPatternDetails;
import appeng.api.networking.crafting.ICraftingProviderHelper;
import appeng.api.networking.events.MENetworkChannelsChanged;
import appeng.api.networking.events.MENetworkEventSubscribe;
import appeng.api.networking.events.MENetworkPowerStatusChange;
import appeng.api.networking.security.BaseActionSource;
import appeng.api.networking.ticking.IGridTickable;
import appeng.api.networking.ticking.TickRateModulation;
@ -43,6 +46,18 @@ public class TileInterface extends AENetworkInvTile implements IGridTickable, IS
ForgeDirection pointAt = ForgeDirection.UNKNOWN;
DualityInterface duality = new DualityInterface( gridProxy, this );
@MENetworkEventSubscribe
public void stateChange(MENetworkChannelsChanged c)
{
duality.notifyNeightbors();
}
@MENetworkEventSubscribe
public void stateChange(MENetworkPowerStatusChange c)
{
duality.notifyNeightbors();
}
public void setSide(ForgeDirection axis)
{
if ( Platform.isClient() )