Adding tags to inspect and getItemDetail
AdVerhoeven opened this issue ยท 1 comments
Could it be possible to have the item/block tags show when running their respective turtle methods?
A great example would be to check if the tags of a block you inspect include the #[namespace]:ores tag, this means that they are a type of ore so your turtle can start mining.
Since the addition of tags in datapacks it is possible to tag items and blocks into groups. Forge does this a lot, ores, stone, etc.. The tags can be a really powerful tool and most functionality should be provided by forge itself. Whenever forge does not list a certain mod item/block under its extensive tag list you can add these tags by changing/updating the datapack that is being used for your server or world.
I am not fully into how tags can/are retrieved or how expensive (to compute) this would be but it seems to me that they added tags for a reason. They are put in a lot of in-game logic, even the base game has a few tags that are looked for to validate whether something can be planted or if something belongs to a class of blocks (signs,fences,walls). I cannot see any other reasoning behind this than that mojang wanted to group these blocks together because they are simply reskins or share behavior.
Pros:
- Check for certain block- or itemclasses by tag, this saves looping trough the 16 different type of stairs for example.
- Sort items by tags with your turtles or other inventory hardware.
- Improved readability and less lines of code because you need less tables.
- Fully customizable by changing/adding datapack(s)
- Might make life easier when using cc:t with other mods since most mods have their own datapack(s) with tags in them.
- Requires no new methods, but I could imagine this to be deemed not OK for CC:T itself in which case I hope some people working on plethora or other additions read this.
Cons:
- Might be computationally expensive (I have no modding experience or clues on how tags are being obtained by the game)
- Makes some code (too?) simple
TL;DR; Is it possible to add item and block tags to their respective methods.
Maybe can be done with the same update as #452