Fixed a crash when writing NBT.
This commit is contained in:
parent
2b6cca0267
commit
82d1f8f506
1 changed files with 7 additions and 3 deletions
|
@ -230,12 +230,16 @@ public class PartCable extends AEBasePart implements IPartCable
|
|||
|
||||
if ( Platform.isServer() )
|
||||
{
|
||||
IGridNode node = getGridNode();
|
||||
int howMany = 0;
|
||||
|
||||
for (IGridConnection gc : getGridNode().getConnections())
|
||||
howMany = Math.max( gc.getUsedChannels(), howMany );
|
||||
if ( node != null )
|
||||
{
|
||||
for (IGridConnection gc : node.getConnections())
|
||||
howMany = Math.max( gc.getUsedChannels(), howMany );
|
||||
|
||||
data.setByte( "usedChannels", (byte) howMany );
|
||||
data.setByte( "usedChannels", (byte) howMany );
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue