@Override public void handlePacketData( INetworkManager network, int packetType, Packet250CustomPayload packet, EntityPlayer player, ByteArrayDataInput dataStream) { try { this.mainBlockPosition = new Vector3(dataStream.readDouble(), dataStream.readDouble(), dataStream.readDouble()); } catch (Exception e) { e.printStackTrace(); } }
@Override public void onReceivePacket(int packetID, ByteArrayDataInput dataStream) throws IOException { super.onReceivePacket(packetID, dataStream); if (packetID == TilePacketType.DESCRIPTION.ordinal()) { this.isInversed = dataStream.readBoolean(); this.wattsReceived = dataStream.readDouble(); // this.processTime = dataStream.readInt(); } else if (packetID == TilePacketType.TOGGLE_MODE.ordinal()) { this.isInversed = !this.isInversed; } }
@Override public Object read(ByteArrayDataInput dat) { return dat.readDouble(); }