Fixed a crash when writing NBT.
This commit is contained in:
@@ -230,12 +230,16 @@ public class PartCable extends AEBasePart implements IPartCable
|
|||||||
|
|
||||||
if ( Platform.isServer() )
|
if ( Platform.isServer() )
|
||||||
{
|
{
|
||||||
|
IGridNode node = getGridNode();
|
||||||
int howMany = 0;
|
int howMany = 0;
|
||||||
|
|
||||||
for (IGridConnection gc : getGridNode().getConnections())
|
if ( node != null )
|
||||||
howMany = Math.max( gc.getUsedChannels(), howMany );
|
{
|
||||||
|
for (IGridConnection gc : node.getConnections())
|
||||||
|
howMany = Math.max( gc.getUsedChannels(), howMany );
|
||||||
|
|
||||||
data.setByte( "usedChannels", (byte) howMany );
|
data.setByte( "usedChannels", (byte) howMany );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user