Fixed junction crash

This commit is contained in:
Anuken 2018-02-10 15:32:58 -05:00
parent 0b09ca0817
commit a496c8ae3e

View File

@ -69,7 +69,7 @@ public class Junction extends Block{
JunctionEntity entity = tile.entity(); JunctionEntity entity = tile.entity();
boolean x = tile.x == source.x; boolean x = tile.x == source.x;
if((x && entity.bx.full()) || (!x && entity.by.full())) return false; if(entity == null || entity.bx == null || entity.by == null || (x && entity.bx.full()) || (!x && entity.by.full())) return false;
int dir = source.relativeTo(tile.x, tile.y); int dir = source.relativeTo(tile.x, tile.y);
if(dir == -1) return false; if(dir == -1) return false;
Tile to = tile.getNearby(dir); Tile to = tile.getNearby(dir);