DenizenScript / Denizen

NPC and general Spigot scripting, using the Denizen Scripting Language!
https://denizenscript.com/
MIT License
213 stars 106 forks source link

Fix `ItemTag.can_destroy/place_on` properties #2624

Closed tal5 closed 5 months ago

tal5 commented 5 months ago

Additions

Changes

[!NOTE] Named the ItemHelper methods CanBreak instead of CanDestroy because that's what Mojang calls it now, and makes sense to reflect the internal naming for the thing it's setting there even if the Denizen naming is different imo - let me know if you'd prefer matching the Denizen naming though.

[!NOTE] Kept the NBT handling in CustomNBT as it's methods that will eventually be removed either way & didn't want to clutter ItemHelper, but let me know if we should just move them there.

[!NOTE] This doesn't represent the full thing anymore, as Mojang added block state & tile entity NBT predicates to these values. Didn't want to implement this right now as A. this is mostly a "make it work" PR, B. not sure how to cleanly represent something like this in Denizen currently, and C. this is something Paper is adding API for, so we're probably better off waiting for that and implementing it based on what they add, to avoid being stuck with NMS forever. To avoid item data getting erased was thinking to add a raw_properties property to still persist stuff that aren't properly represented in Denizen properties yet (like what raw_nbt used to do).