Jump to content

[1.10.2] NBT help


bongotezz

Recommended Posts

Hello

 

I've been working on learning how to generate structures in the world from schematic files. I found the java library jnbt and was able to get it to work for some things but the tile entity list is not in the correct format that Minecraft likes for it's NBT Compound tags. I could parse the jnbt output myself but it seems like a lot of overhead that i shouldn't be doing. I should be using the nbt classes built into Minecraft. During my many searches i find old code such as:

 

short width = nbt.getShort("Width");

short height = nbt.getShort("Height");

short length = nbt.getShort("Length");

 

The authors indicate that minecraft has it's own built in nbt support but this code no longer works. I found the net.minecraft.nbt.* classes and looked through them. I found that i can send my input stream to nbt.CompressedStreamTools.readCompressed and get a NBTTagCompound returned. I assume this would be for the entire schematic. After this I'm not sure what to do. I've looked through the nbt classes and can't find anything that will accept either the input stream or the NBTTagCompound and return width, height, length, block and meta data arrays and the 2 entity lists. Does anyone have any guidance for me?

 

Thanks in advance.

 

Bongo

Link to comment
Share on other sites

I found the following in some code on github.

 

    short width = tagCompound.func_74765_d("Width");

    short length = tagCompound.func_74765_d("Length");

    short height = tagCompound.func_74765_d("Height");

 

tagCompound is an NBTTagCompound as shown in the method below.

 

public ISchematic readFromNBT(NBTTagCompound tagCompound)

 

Is anyone familiar with this func_74765_d?  I can't seem to find this anywhere in the NBTTagCompound class.

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.