Posted January 1, 20178 yr 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 My Youtube Page - https://www.youtube.com/channel/UCap3K9FEincZB_pzAOi-1kQ
January 1, 20178 yr Author 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. My Youtube Page - https://www.youtube.com/channel/UCap3K9FEincZB_pzAOi-1kQ
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.