crazysnailboy / UncraftingTable

A minecraft mod to allow uncrafting of items in exchange for XP
GNU Lesser General Public License v3.0
9 stars 6 forks source link

Suggestion: NBT-tag disable. #19

Open MentalMouse opened 7 years ago

MentalMouse commented 7 years ago

As a supplement to the new CraftTweaker integration, I'd suggest you add one thing on your side, for features that i don't think CraftTweaker can quite do: Check input items for an NBT tag to the effect of {Uncrafter value} ; The value can be {} or "0" to bar the item from uncrafting, "1" to explicitly permit uncrafting (also the tagless default), or (optionally) provide a custom uncrafting result, for the marked item only.

(CraftTweaker can do the first two for a particular item. IIUC how it works, asking it to do this for "any item at all" either would be forbidden, or probably should be.)

crazysnailboy commented 7 years ago

Unfortunately it doesn't look like you can combine the wildcard item with .withTag - otherwise this would work:

<*>.withTag({uncrafter:0}) 

I'm not sure I see the use-case for this though - how would an item end up with an "uncrafter" NBT tag on it?

MentalMouse commented 7 years ago

Yeah, wildcards tend to translate into multiple recipes, except where the underlying logic can see a common identity. Doing that for <*> would be... bad.

This trick would be for modpackers, mapmakers, adventure writers and such, to help protect plot-relevant or otherwise restricted items. Even a Ruins pack could use it so that, say, a mob-dropped Looting VI gold sword doesn't immediately translate into Enchanted Book: Looting VI. Of course, there would still be ways around it, like anvil-repairing the sword -- but for a mapmaker or such it's at least something.