Advertisement
Guest User

Extended_Jamiga

a guest
Apr 12th, 2014
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. package aJamigaPack1;
  2.  
  3. import java.io.ByteArrayOutputStream;
  4. import java.io.DataOutputStream;
  5.  
  6. import net.minecraft.network.packet.Packet250CustomPayload;
  7.  
  8. public class PacketOpenServerGui
  9. {
  10. public static Packet250CustomPayload getPacket(int guiID)
  11. {
  12. ByteArrayOutputStream bos = new ByteArrayOutputStream(5);
  13. DataOutputStream outputStream = new DataOutputStream(bos);
  14.  
  15. try {
  16. // Notice this first line writes the packet id - do this in your ExtendedPlayer.sync() method as well and add 1 to the size.
  17. outputStream.writeByte(PacketHandler.OPEN_SERVER_GUI);
  18. outputStream.writeInt(guiID);
  19. } catch (Exception ex) {
  20. ex.printStackTrace();
  21. }
  22.  
  23. return new Packet250CustomPayload("tutchannel", bos.toByteArray());
  24. }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement