Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

[1.8.8]Tile Entity NBT Reading on client


Atijaf
 Share

Recommended Posts

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?

Link to comment
Share on other sites

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)

Link to comment
Share on other sites

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

Is that correct?

That is not correct, how would that even work? The client does not have access to the save file (remember, the server can be across the world only connected via internet!), only the server reads NBT data.

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)

There is something severely wrong with your code if that's the case.
Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share



×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.