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

I have a boolean called isLinked.

That determines a number of things, which is whether or not the player can use it and if the block should have particles.

 

It saves everything just fine, but is there something I'm missing, because when I debug, it isn't updated server side when reading.

Do I need to send a packet to the server, or is there something that I can implement in my class that'll take care of it?

  • Author

I'm not sure I quite understand.  I Notice that it's only saving nbt on the client side.

Is that correct?

 

Why is it that when I load back into the game, the server still doesn't update it's data.  (Client data is correct, server data isn't)

  • Author

There is something severely wrong with your code if that's the case.

 

You are most likely correct...

 

Main tile entity class -- EnergyTE

http://pastebin.com/kwCEgV6W

 

Teleporter Tile Entity class -- the one with the issue, but I'm sure it's related to the main TE class

http://pastebin.com/S2tMU2qn

 

Teleporter Container -- Not sure if needed, but just in case

http://pastebin.com/zcXTMCYW

 

Yikes!  I always get so nervous when I share my code.  All I know is i'm super happy it's not the code it use to be.  The previous code would give everyone a heart attack -- (Wrote code, caused problems, wrote more code to solve problems, caused more problems and so on... haha)

 

Thanks for helping!

 

Edit: Noticed #markDirty() was called every tick.  Fixed it

  • Author

The setting

 

Prior to saving and quitting, it is working properly.

But when I load the game..

 

When the TE is linked, it displays particles above it.

Also, when the inventory is opened, text is displayed saying whether or not it is linked.  It says it isn't.

While debugging, I notice that #world.isRemote is always false while reading from nbt.

 

But here is the interesting part.  When I open one of the TE's, it still doesn't work.  But when I open the second TE, (The one that it's suppose to be linked to) everything goes back into motion and particles are displayed on both blocks, as well as a message saying they are linked.

 

Edit: worldObj is now null.  Maybe I misread.  So now I can't really tell.  I'm guessing that is is being run on the server side, because #readFromNBT is being called twice

  • Author

Would detectAndSendChanges() do the trick?  I want it to update on game load, so probably not.  And you're definitely correct about it saving serverside.  Sorry about that

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.