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

Okay so I just got into modding, I have quite a bit experience with Java as I've created a java game as the project before this one, anyways my problem is that i have one TileEntity on the server and one on the Client, the problem is that they don't sync there variables :( So my problem is that I do get power into both entities, although one is drained bu the client gui still think it have power as it gets the client entity instread of the server entity  :'( I've been googling around for quite a time now and haven't found any solution to this so I hope i can get some here!

 

The TileEntity: https://github.com/vpklotar/Industrial-Line/blob/master/src/se/vpklotar/li/block/furnace/FurnaceEntity.java

The block: https://github.com/vpklotar/Industrial-Line/blob/master/src/se/vpklotar/li/block/furnace/Mk1Furnace.java

 

Main file: https://github.com/vpklotar/Industrial-Line/blob/master/src/se/vpklotar/il/Il.java

there are methods called getDatapacket and onDataPacketrecived in the TileEntity. These get passed from the server to the client every time the block is marked for an update (via world.markBlockForUpdate). You can write the NBT for the server tile to the packet sent form this, then read it on the client. That's how i do it for one of my tile entities, Not quite as complex as yours but it should still apply.

Sync with packets, using the classes in the FML.packet (or something like that, look for PacketDispatcher) and the getDescriptionPacket() in TileEntity.

 

Don't use too many packets, you'll bog down the server, client, and everything else on your computer.

So, what would happen if I did push that shiny red button over there? ... Really? ... Can I try it? ... Damn.

  • Author

Okay, so ill try the getDataPacket() and see what i can get, i tried with the packets but i didn't get them to sync? Anyway, I'll try that out and reply if I can't get it to work, otherwise a "Thank You" will get thrown out :)

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.