Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding tags to inspect and getItemDetail #461

Closed
AdVerhoeven opened this issue May 29, 2020 · 1 comment
Closed

Adding tags to inspect and getItemDetail #461

AdVerhoeven opened this issue May 29, 2020 · 1 comment
Labels
area-Minecraft This affects CC's Minecraft-specific content. enhancement An extension of a feature or a new feature.

Comments

@AdVerhoeven
Copy link

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.

@AdVerhoeven AdVerhoeven added the enhancement An extension of a feature or a new feature. label May 29, 2020
@SquidDev SquidDev added the area-Minecraft This affects CC's Minecraft-specific content. label May 29, 2020
@Lupus590
Copy link
Contributor

Maybe can be done with the same update as #452

SquidDev added a commit that referenced this issue Jun 1, 2020
This is simply exposed as a table from tag -> true. While this is less
natural than an array, it allows for easy esting of whether a tag is
present.

Closes #461
@SquidDev SquidDev closed this as completed Jun 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-Minecraft This affects CC's Minecraft-specific content. enhancement An extension of a feature or a new feature.
Projects
None yet
Development

No branches or pull requests

3 participants