Jump to content

[1.7.10] NBT Data and Its Extensive Documentation


HalestormXV

Recommended Posts

Hello there. So I just pushed my mod into a release candidate and it works awesome on Single Player. I have quite literally 0 issues. And that is thanks to the wide variety of help I have gotten from this community especially. I have a simple question. Some of my items utilize NBT data in which I followed the documentation from various sources as well as retrieved help from the various community members here.

 

I put my mod into a network environment (SMP) and I fear something may be wrong. I haven't had the chance to test it quite yet however it occurred to me that two items specifically utilize NBT data in their code however they do not have a writeToNBT function or readFromNBT aside from the TagCompound functions within their classes. Now although they store NBT data (for example one items stores how many times you have used it and the other stores a cooldown of the item and both store the names of the user) do those functions automatically get written to the server data and read from the server data simply by calling the stackTagCompound.setInteger or the stackTagCompound.getInteger? Or do you need to create different functions to have the data written to the server and read from the server?

 

Here are my two classes that utilize NBT. Both of these are items however neither of them have a write toNBT or loadfromNBT function like my TileEntity class for my furnace which works fine on SMP

http://pastebin.com/3wn7qECD

 

http://pastebin.com/fA75J4Yy

 

If anyone can take a quick browse through that and let me know if it should work fine on SMP i appreciate it. Or do I need these writeNBT and loadNBT functions. Like I said I haven't gotten to test it yet but do plan to. But I know it does work just fine on my singleplayer world as I have tested it there.

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
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
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.

Announcements



×
×
  • Create New...

Important Information

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