Posted March 31, 20169 yr This probably isn't 1.9 specific but I'm coding for 1.9. Let's say I have this code: NBTTagCompound tag1 = new NBTTagCompound(); tag1.setString("alpha-string", "Alex"); tag1.setString("bravo-string", "John"); FMLLog.info(tag1.toString()); NBTTagCompound tag2 = new NBTTagCompound(); tag2.setString("charlie-string", "Chris"); tag2.setString("delta-string", "Bob"); NBTTagList tag3 = new NBTTagList(); tag3.appendTag(new NBTTagInt(3)); tag3.appendTag(new NBTTagInt(2)); tag3.appendTag(new NBTTagInt(1)); tag2.setTag("echo-tag-list", tag3); FMLLog.info(tag2.toString()); Which prints this: {alpha-string:"Alex",bravo-string:"John"} {charlie-string:"Chris",echo-tag-list:[0:3,1:2,2:1],delta-string:"Bob"} For the first compound tag the result makes sense, alpha-string was added before bravo-string and thus appears first. But for the second compound tag the result doesn't follow suit. echo-tag-list appears before delta-string despite being added after. Why is this? I like trains.
March 31, 20169 yr I'm pretty sure that internally it get treated like a hashmap of <String, NBTBase> and hashmaps do not guarantee an order. Current Project: Armerger Planned mods: Light Drafter | Ore Swords Looking for help getting a mod off the ground? Coding | Textures
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.