Fixed grid searching controller over null blocks

When placing a cable above a door and triggering a searchController
call from a connected grid (e.g. by loading the chunk), then onConnected
would try to notify neighbors of a state change with block set to null.
This caused a NPE down the line.
This commit is contained in:
thraaawn
2016-06-19 11:35:53 +02:00
parent 267b2c1916
commit 2690f58315

View File

@@ -81,7 +81,7 @@ public abstract class TileMachine extends TileBase implements ISynchronizedConta
}
public void onConnected(World world, TileController controller) {
if (tryConnect(controller)) {
if (tryConnect(controller) && block != null) {
world.notifyNeighborsOfStateChange(pos, block);
}
}