Closed AdmiralFrijoles closed 10 years ago
Hi, thanks for the PR, however exposing NBT data to the user isn't something I feel comfortable with. It's not meant for public consumption.
I can see where you are coming from on that. I do feel however that there needs to be a way to compare item stacks further. I ran into a bit of a bump with a couple of items that are only differ in their tags.
How about adding an "Item Analyser" Block to https://github.com/OpenMods/OpenPeripheral-Addons/ to add some cost to this feature as it allows a lot of very advanced stuff? Also, then it could be easily disabled in the config file by setting the block's ID to 0, in case some server do not want this.
Then something like areStacksIdentical should be used to check two slots against each other.
Exposing NBT has been discussed for a long time and we've always decided against it. It seems far too much of an intrusion into other mods code and methods. Some data is meant to be private.
I'd much rather code be added to append additional information to certain items than to blanket-expose everything.
Vexatos, no. Its not the cost that is the issue.
@mikeemoo But there definitely needs to be an option to disable this on a server.
OK, I see what you mean. There could potentially be some sensitive information in the tag I guess. As far as the other properties go those are OK yes?
Yup the others seem fine!
@mikeemoo Alrighty, thanks for the quick replies! I did find it odd that there was no way to access the NBT data, however I understand why now haha. I do personally think that the feature should be available as a config option though, but that is ultimately up to you. Anyway, thanks again.
I have exposed a few more properties for item stacks. The compound tag of the item stack is the most interesting as it allows access to data that would otherwise be unavailable. It can also be used to further compare stacks in Lua. I have also exposed the item's max damage to allow for displaying durability as a percentage, as well as checking if the item is even damageable at all. I have also included "maxStackSize" and "isStackable" for good measure. I know I would use all of these quite regularly, I feel as though others would find all of this extremely useful as well.