Small fixes
This commit is contained in:
@@ -53,6 +53,13 @@ public interface INetworkNode {
|
||||
*/
|
||||
void onDisconnected();
|
||||
|
||||
/**
|
||||
* Called when the connection state of this node changes.
|
||||
* This is also called when redstone mode is updated, as opposed to {@link INetworkNode#onConnected(INetworkMaster)} and {@link INetworkNode#onDisconnected()}.
|
||||
*
|
||||
* @param network The network
|
||||
* @param state The state
|
||||
*/
|
||||
void onConnectionChange(INetworkMaster network, boolean state);
|
||||
|
||||
/**
|
||||
|
||||
@@ -49,11 +49,7 @@ public abstract class BlockNode extends BlockBase {
|
||||
@Override
|
||||
public void breakBlock(World world, BlockPos pos, IBlockState state) {
|
||||
if (!world.isRemote) {
|
||||
TileNode node = (TileNode) world.getTileEntity(pos);
|
||||
|
||||
if (node.isConnected()) {
|
||||
node.onBreak(world);
|
||||
}
|
||||
((TileNode) world.getTileEntity(pos)).onBreak(world);
|
||||
}
|
||||
|
||||
super.breakBlock(world, pos, state);
|
||||
|
||||
@@ -126,6 +126,10 @@ public abstract class TileNode extends TileBase implements INetworkNode, ISynchr
|
||||
|
||||
@Override
|
||||
public void onBreak(World world) {
|
||||
if (network == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
List<INetworkNode> nodes = new ArrayList<INetworkNode>();
|
||||
Set<BlockPos> nodesPos = new HashSet<BlockPos>();
|
||||
|
||||
@@ -184,10 +188,6 @@ public abstract class TileNode extends TileBase implements INetworkNode, ISynchr
|
||||
|
||||
this.connected = true;
|
||||
this.network = network;
|
||||
|
||||
if (canSendConnectivityUpdate()) {
|
||||
RefinedStorageUtils.updateBlock(worldObj, pos);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -196,10 +196,6 @@ public abstract class TileNode extends TileBase implements INetworkNode, ISynchr
|
||||
|
||||
this.connected = false;
|
||||
this.network = null;
|
||||
|
||||
if (canSendConnectivityUpdate()) {
|
||||
RefinedStorageUtils.updateBlock(worldObj, pos);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user