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:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user