Posted August 9, 201510 yr I've got an class that extends ExtendedEntityProperties that handles simple data (doubles, strings etc) for a player.... How does one go about implementing something more complex (like an array of doubles, or another custom object ?). I am looking for a way to properly handle something relatively simple (a collection of doubles) to something more complex (saving a buffer of data which contains collections of multiple objects that form a data structure).... I don't keep an open mind lest someone try to fill it with garbage - Mark Twain
August 9, 201510 yr Author I was under the impression that you get/set NBTTagCompound variables with methods like getDouble(value) and setDouble(value). How does one get/set the NBTTagCompount properties with a collection (or a complex data object) ? I don't keep an open mind lest someone try to fill it with garbage - Mark Twain
August 9, 201510 yr Author That points me in the right direction, thanks ! But is that the only way to handle keeping data on an entity ? I don't keep an open mind lest someone try to fill it with garbage - Mark Twain
August 9, 201510 yr Oh, you are talking about encoding to NBT (please don't tell me you have NBT fields in your IEEP). What exactly did you mean by that? Isn't IEEP made up of NBT fields? Or are you talking about putting a full compound into the IEEP? In the case of putting a full compound into the IEEP, I actually think that is a good way to do it, because then your compound is more likely to be compatible with other mods -- what if your mod and another mod both add a "mana" field to the IEEP? Or maybe IEEP already handles that with an IEEP for each mod separately? Anyway, when I use IEEP I tend to make a full compound, fill it with my tag fields, then write that with a mod-specific tag to IEEP. Check out my tutorials here: http://jabelarminecraft.blogspot.com/
August 10, 201510 yr Hi FYI This example class might be useful background info if you haven't used NBT before https://github.com/TheGreyGhost/MinecraftByExample/blob/master/src/main/java/minecraftbyexample/mbe20_tileentity_data/TileEntityData.java (see writeToNBT() and readFromNBT() ) -TGG
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.