Show Channel Usage for smart and dense cable in Waila.
Waila Plugin now works when parts are in FMP Tiles.
This commit is contained in:
@@ -9,6 +9,7 @@ import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
@@ -222,6 +223,23 @@ public class PartCable extends AEBasePart implements IPartCable
|
||||
getHost().markForUpdate();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound data)
|
||||
{
|
||||
super.writeToNBT( data );
|
||||
|
||||
if ( Platform.isServer() )
|
||||
{
|
||||
int howMany = 0;
|
||||
|
||||
for (IGridConnection gc : getGridNode().getConnections())
|
||||
howMany = Math.max( gc.getUsedChannels(), howMany );
|
||||
|
||||
data.setByte( "usedChannels", (byte) howMany );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToStream(ByteBuf data) throws IOException
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user