Advertisement
Corosus

Untitled

Sep 21st, 2012
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.89 KB | None | 0 0
  1. if (syncDelay <= 0 && MinecraftServer.getServer() != null)
  2.             {
  3.                 syncDelay = 5;
  4.                 ByteArrayOutputStream bos = new ByteArrayOutputStream(140);
  5.                 DataOutputStream dos = new DataOutputStream(bos);
  6.  
  7.                 try
  8.                 {
  9.                     dos.writeFloat(wind.strength);
  10.                     dos.writeFloat(wind.direction);
  11.                 }
  12.                 catch (Exception ex)
  13.                 {
  14.                     ex.printStackTrace();
  15.                 }
  16.  
  17.                 Packet250CustomPayload pkt = new Packet250CustomPayload();
  18.                 pkt.channel = "WindData";
  19.                 pkt.data = bos.toByteArray();
  20.                 pkt.length = bos.size();
  21.                 //pkt.isChunkDataPacket = true;
  22.                 MinecraftServer.getServer().getConfigurationManager().sendPacketToAllPlayers(pkt);
  23.             }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement