Improved Exception for http://openeye.openmods.info/crashes/d2df850ad1915a015a80f9f7cef56ac3 Improved Exception for http://openeye.openmods.info/crashes/c8a3f70288f017726c5acd09ea91a2b0
This commit is contained in:
@@ -170,25 +170,28 @@ public class CableBusContainer implements AEMultiTile, ICableBusContainer
|
|||||||
is.stackSize = 1;
|
is.stackSize = 1;
|
||||||
|
|
||||||
IPart bp = bi.createPartFromItemStack( is );
|
IPart bp = bi.createPartFromItemStack( is );
|
||||||
if ( bp instanceof IPartCable )
|
if ( bp != null )
|
||||||
{
|
{
|
||||||
boolean canPlace = true;
|
if ( bp instanceof IPartCable )
|
||||||
for (ForgeDirection d : ForgeDirection.VALID_DIRECTIONS)
|
{
|
||||||
if ( getPart( d ) != null && !getPart( d ).canBePlacedOn( ((IPartCable) bp).supportsBuses() ) )
|
boolean canPlace = true;
|
||||||
canPlace = false;
|
for (ForgeDirection d : ForgeDirection.VALID_DIRECTIONS)
|
||||||
|
if ( getPart( d ) != null && !getPart( d ).canBePlacedOn( ((IPartCable) bp).supportsBuses() ) )
|
||||||
|
canPlace = false;
|
||||||
|
|
||||||
if ( !canPlace )
|
if ( !canPlace )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return getPart( ForgeDirection.UNKNOWN ) == null;
|
return getPart( ForgeDirection.UNKNOWN ) == null;
|
||||||
}
|
}
|
||||||
else if ( !(bp instanceof IPartCable) && side != ForgeDirection.UNKNOWN )
|
else if ( !(bp instanceof IPartCable) && side != ForgeDirection.UNKNOWN )
|
||||||
{
|
{
|
||||||
IPart cable = getPart( ForgeDirection.UNKNOWN );
|
IPart cable = getPart( ForgeDirection.UNKNOWN );
|
||||||
if ( cable != null && !bp.canBePlacedOn( ((IPartCable) cable).supportsBuses() ) )
|
if ( cable != null && !bp.canBePlacedOn( ((IPartCable) cable).supportsBuses() ) )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return getPart( side ) == null;
|
return getPart( side ) == null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
@@ -701,7 +704,7 @@ public class CableBusContainer implements AEMultiTile, ICableBusContainer
|
|||||||
p.readFromNBT( extra );
|
p.readFromNBT( extra );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
throw new RuntimeException( "Invalid NBT For CableBus Container." );
|
throw new RuntimeException( "Invalid NBT For CableBus Container: " + iss.getItem().getClass().getName() + " is not a valid part." );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user