this.lastReading = this.electricityReading;
if (!this.worldObj.isRemote)
{
ForgeDirection inputDirection = ForgeDirection.getOrientation(ROTATION_MATRIX[this.getBlockMetadata()]);
TileEntity inputTile = VectorHelper.getTileEntityFromSide(this.worldObj, new Vector3(this), inputDirection);
if (inputTile != null && inputTile instanceof INetworkProvider)
{
if (inputTile instanceof IConductor)
{
this.network = ((IConductor) inputTile).getNetwork();
ElectricityPack temp = ElectricExpansionEventHandler.INSTANCE.getNetworkStat(this.network);
ElectricExpansionEventHandler.INSTANCE.cleanNetworkStat(this.network);
if (temp != null)
{
this.electricityReading = temp.clone();
this.electricityReading.amperes *= 20.0F;
}
else
{
this.electricityReading = EMPTY_PACK.clone();
}
}
else
{
this.network = ((INetworkProvider) inputTile).getNetwork();
this.electricityReading = EMPTY_PACK.clone();
}
}
else
{
this.electricityReading = EMPTY_PACK.clone();
}
if (this.electricityReading.amperes != this.lastReading.amperes)
{
PacketManager.sendPacketToClients(this.getDescriptionPacket(), this.worldObj, new Vector3(this), 20.0D);
}
}
}
}