wisp-forest / gadget

Debugger's Delight
https://modrinth.com/mod/gadget
GNU Lesser General Public License v3.0
46 stars 8 forks source link

Allow locking NBT tags during certain Item methods #25

Closed BasiqueEvangelist closed 3 months ago

BasiqueEvangelist commented 1 year ago

As an example, Item#getName shouldn't really ever modify the item's NBT tag, as that can cause very strange problems with item deduplication. gadget™ should ideally have an option to disallow writing into the ItemStack#nbt field or the contained tag's tree.

Remaining tasks:

BasiqueEvangelist commented 1 year ago

Partially implemented, though it might leak the locked NBT state out of the method if an exception is thrown

BasiqueEvangelist commented 3 months ago

Irrelevant after 1.20.5 update.