Skip to content

Commit

Permalink
Merge pull request #307 from Adaptivity/crashfix
Browse files Browse the repository at this point in the history
Fix crash when placing crate at Y = 1
  • Loading branch information
Victorious3 committed Sep 15, 2015
2 parents 595ee16 + 3bbcf12 commit 5ca589b
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,13 @@ public boolean canConnect(IBlockAccess world, int x, int y, int z, ForgeDirectio
int offX = x + connected.offsetX;
int offY = y + connected.offsetY;
int offZ = z + connected.offsetZ;

if (offY <= 0) return false;

TileEntityCrate connectedCrate = WorldUtils.get(world, offX, offY, offZ, TileEntityCrate.class);
if (connectedCrate == null) return false;
TileEntityCrate crate = WorldUtils.get(world, x, y, z, TileEntityCrate.class);
return (crate.getID() == connectedCrate.getID());
return (crate.getID() == connectedCrate.getID() && !crate.equals(connectedCrate));
}
}

Expand Down

0 comments on commit 5ca589b

Please sign in to comment.