Re-added Controllers exploding when two of them are connected to the same network

This commit is contained in:
Raoul Van den Berge
2016-07-06 14:24:11 +02:00
parent 27ca31d858
commit 012e737c5d
3 changed files with 12 additions and 1 deletions

View File

@@ -6,6 +6,9 @@
- Fixed wireless signal starting from Controller instead of per Wireless Transmitter individually - Fixed wireless signal starting from Controller instead of per Wireless Transmitter individually
- Huge performance improvements to large networks - Huge performance improvements to large networks
**Features**
- Re-added Controllers exploding when two of them are connected to the same network
### 0.8.5 ### 0.8.5
**Bugfixes** **Bugfixes**
- Fixed crash when Tesla API is not installed - Fixed crash when Tesla API is not installed

View File

@@ -59,7 +59,11 @@ public abstract class BlockNode extends BlockBase {
@Override @Override
public void breakBlock(World world, BlockPos pos, IBlockState state) { public void breakBlock(World world, BlockPos pos, IBlockState state) {
if (!world.isRemote) { if (!world.isRemote) {
(((TileNode) world.getTileEntity(pos)).getNetwork()).rebuildNodes(); TileEntity tile = world.getTileEntity(pos);
if (tile instanceof TileNode && ((TileNode) tile).isConnected()) {
(((TileNode) tile).getNetwork()).rebuildNodes();
}
} }
super.breakBlock(world, pos, state); super.breakBlock(world, pos, state);

View File

@@ -398,6 +398,10 @@ public class TileController extends TileBase implements INetworkMaster, IEnergyR
while ((currentPos = toCheck.poll()) != null) { while ((currentPos = toCheck.poll()) != null) {
TileEntity tile = worldObj.getTileEntity(currentPos); TileEntity tile = worldObj.getTileEntity(currentPos);
if (tile instanceof TileController && !pos.equals(tile.getPos())) {
worldObj.createExplosion(null, tile.getPos().getX(), tile.getPos().getY(), tile.getPos().getZ(), 4.5f, true);
}
if (!(tile instanceof INetworkNode)) { if (!(tile instanceof INetworkNode)) {
continue; continue;
} }