CC: Tweaked

CC: Tweaked

42M Downloads

Adding tags to inspect and getItemDetail

AdVerhoeven opened this issue ยท 1 comments

commented

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:

  1. Check for certain block- or itemclasses by tag, this saves looping trough the 16 different type of stairs for example.
  2. Sort items by tags with your turtles or other inventory hardware.
  3. Improved readability and less lines of code because you need less tables.
  4. Fully customizable by changing/adding datapack(s)
  5. Might make life easier when using cc:t with other mods since most mods have their own datapack(s) with tags in them.
  6. 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:

  1. Might be computationally expensive (I have no modding experience or clues on how tags are being obtained by the game)
  2. Makes some code (too?) simple

TL;DR; Is it possible to add item and block tags to their respective methods.

commented

Maybe can be done with the same update as #452