Posted May 30, 20187 yr How would I go about interfacing between a button clicked between my GUI and Tile entity? I know it has to do with Packets, but I'm not sure how to send/receive those packets on either end.
May 30, 20187 yr http://mcforge.readthedocs.io/en/latest/networking/simpleimpl/ Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable. If you think this is the case, JUST REPORT ME. Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice. Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked. DO NOT PM ME WITH PROBLEMS. No help will be given.
May 30, 20187 yr Author 3 minutes ago, Draco18s said: http://mcforge.readthedocs.io/en/latest/networking/simpleimpl/ This shows me how to create the bare bones implementation, but there isn't anything pertaining to how to use it in the slightest, or if there is, it doesn't make any sense to me, at least to a tileEntity, because I can see how to send something to a server, but I can't tell how to read it or even receive it. Edited May 30, 20187 yr by BURN447
May 30, 20187 yr When the button is clicked -> send a packet to the server with the relevant information (TE's pos, what button was clicked). Server gets the packet, reads the data, gets the TileEntity from the position encoded in the packet, and does things (if valid to perform). Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable. If you think this is the case, JUST REPORT ME. Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice. Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked. DO NOT PM ME WITH PROBLEMS. No help will be given.
May 30, 20187 yr Author How would I interpret what is happening in the tileEntity itself? I'm assuming it has to do with the onDataPacket function
May 30, 20187 yr You want to know what data the TE has? Yes, you override those three methods. Yes there are three. getDataPacket: sending getUpdateTag: sending onDataPacket: recieving Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable. If you think this is the case, JUST REPORT ME. Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice. Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked. DO NOT PM ME WITH PROBLEMS. No help will be given.
May 30, 20187 yr Author Just now, Draco18s said: You want to know what data the TE has? Yes, you override those three methods. Yes there are three. getDataPacket: sending getUpdateTag: sending onDataPacket: recieving I'm actually trying to send a packet from the client that a button was clicked, and if so, start a process on the server, which would then set the variable on both ends back to false until the button is clicked again. But this is starting to make sense, and I think I might be able to figure it out. I'm thinking that I'd use pkt.readInt and then send one back setting the variable back to false.
May 30, 20187 yr I'm not sure if this is the best implementation, but I did it like so: In the GUI class, when the button is pressed (checked with actionPerformed) you use your packet handler to send to server a custom message with the information you need. When the message is sent to the server, you can set the variable on the server side with a handler. Then inside the server handler you can send a packet to players. MobDrops http://www.planetminecraft.com/mod/125-mobdrops/
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.