Added more null checks, might fix #297

This commit is contained in:
Modmuss50 2015-12-12 11:48:34 +00:00
parent cc6dfbc3c4
commit d64928b4e4

View file

@ -411,6 +411,9 @@ public class CablePart extends ModPart implements IEnergyConductor, INetworkTile
} else {
if (ModPartUtils.hasPart(entity.getWorldObj(), entity.xCoord, entity.yCoord, entity.zCoord, this.getName())) {
CablePart otherCable = (CablePart) ModPartUtils.getPartFromWorld(entity.getWorldObj(), new Location(entity.xCoord, entity.yCoord, entity.zCoord), this.getName());
if(otherCable == null || dir == null){
return false;
}
int thisDir = Functions.getIntDirFromDirection(dir);
int thereDir = Functions.getIntDirFromDirection(dir.getOpposite());
boolean hasconnection = otherCable.connections[thereDir];