@Override public void readData(ByteBuf data) { super.readData(data); displayPower = new short[] {0, 0, 0, 0, 0, 0}; overload = data.readBoolean(); for (int i = 0; i < displayPower.length; i++) { displayPower[i] = data.readUnsignedByte(); } }
@Override public void writeData(ByteBuf data) { super.writeData(data); data.writeBoolean(overload); for (short element : displayPower) { data.writeByte( Math.min( PipeRendererTESR.POWER_STAGES, (int) Math.ceil(element * PipeRendererTESR.DISPLAY_MULTIPLIER))); } }