Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

Hi, I'm dAkshEN3. Some of you might recognise me from the BC forums. I created Advanced Power Systems and am currently in the process of updating it for the new MC and Forge. This also means I need to add multiplayer, which is where my problem arises:

 

I have no idea how the packets and such work to make GUIs and TileEntities and things work in multiplayer.

 

I'm not really looking for a tutorial or an example, I can handle the coding myself, I just need help understanding the theory and the process as I've never ventured into multiplayer game programming before.

"The hypothesis of God gives an incomparably absolute opportunity to understand everything and know absolutely nothing. Give man an extremely simplified system of the world and explain every phenomenon away on the basis of that system." - Arkady/Boris Strugatsky

 

Creator of Advanced Power Systems for BuildCraft

I would recommend looking at cpw's IronChests and CompactSolars mods as examples:  https://github.com/cpw

 

In essence though:

 

GUI:  You have a container on the server side, a GUI on the client side, they talk, plenty of examples in vanilla as to how, but usually it just works.

 

TileEntities:  You use the getDescriptionPacket call or whatever it was to send information to a TileEntity, you want to minimize the size and how often these occur, 'emulate' things on the client if possible, the lower network usage then the better.  :)

  • Author

Ok, is there any circumstance where a TileEntity would need to send packets to the server?

"The hypothesis of God gives an incomparably absolute opportunity to understand everything and know absolutely nothing. Give man an extremely simplified system of the world and explain every phenomenon away on the basis of that system." - Arkady/Boris Strugatsky

 

Creator of Advanced Power Systems for BuildCraft

Ok, is there any circumstance where a TileEntity would need to send packets to the server?

yes when you edit something on the client per say a setting in a GUI you would need to tell the server that setting changed. For example TheCowGod's Locked doors and chest have player list to access. Every time someone add/remove a user to the block it send a packet to the server telling it to remove/add the player from its list as well.

 

https://github.com/TheCowGod/GreaterSecurity <- your welcome to use this as an example for making packets for both client and server.

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.