Posted December 30, 20177 yr Helllo, I have a Method which requires converting a Map<INBTSerializable,Boolean> into NBTTagLists, but it looks like NBTTagByte (and similiar primitves) are package-private classes and there fore cannot be used. More specifically here is some simplified code of what I'm doing: private NBTTagList[] getConditionValueResources() { NBTTagList[] locations = {new NBTTagList(), new NBTTagList() }; for (Map.Entry<ISpellCondition,Boolean> condition : conditions.entrySet()) { locations[0].appendTag(condition.getKey().serializeNBT()); NBTTagCompound compound = new NBTTagCompound(); compound.setBoolean(KEY_BOOLEAN_VALUE,condition.getValue()); locations[1].appendTag(compound); } return locations; } and what I'm looking for would be sth like: private NBTTagList[] getConditionValueResources() { NBTTagList[] locations = {new NBTTagList(), new NBTTagList() }; for (Map.Entry<ISpellCondition,Boolean> condition : conditions.entrySet()) { locations[0].appendTag(new NBTTagBoolean(condition.getValue()); locations[1].appendTag(compound); } return locations; } This piece of code would allow for far less Overhead (an NBTTagCompound is contains an entire Map, although i only need on byte!) and I would omit this stupid converting NBTTagCompound and back... (Note: I know, that there is no NBTTagBoolean Class, but that NBTTagByte is used instead. This would make it far easier too... But it is not public... )
December 30, 20177 yr Author Sry... I'm such an idiot at Times... I used auto completion, and tried to access the private Constructor which naturally wouldn't work (and I didn't try to add a value to it, but rather tried to find an alternative to that...) Sry sry sry sry sry. (I have been looking for that for about the last 1.5h ) (I think programming scince 2 O'clock (am) doesn't do anything good to your mind...) Edit: Is it possible to close Stupid Topics like this? Edited December 30, 20177 yr by Major Tuvok incomplete
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.