Coder Social home page Coder Social logo

Comments (5)

JoshMayberry avatar JoshMayberry commented on July 24, 2024

Looking at the match mod origin flag, I think I was misunderstanding the Match Item Tag flag, and don't understand how it works.

I think something like this is what I was imagining:

if (flags[FilteredPipeBlockEntity.MATCH_ITEM_ID_FLAG]) {
    Set<String> validItemIds = itemStacks.stream()
            .filter(itemStack -> !itemStack.isEmpty())
            .map(ItemStack::getItem)
            .map(Registry.ITEM::getId)
            .collect(Collectors.toSet());

    boolean passes = validItemIds.contains(Registry.ITEM.getId(queryStack.getItem()));

    queryStackParityPasses.add(passes);
    flagPasses.add(passes);
}

(It's just the match mod origin flag without the namespace portion)

My ultimate goal is to not need to put every type of log in a filter to filter all log types, or every type of wool in a filter to filter all wool colors, etc. :)
I guess the ore dictionary is a forge thing- not a minecraft thing; that was what I thought could originally do this- but sorting by block ID should work as well?

from ezpas.

cakewhip avatar cakewhip commented on July 24, 2024

I'm not sure that blocks and items are still backed by a predefined integer (the registry system does use identifying integers underneath depending on when they were loaded in, but I haven't dug deep enough to reach it). But it's unrelated as the filter option actually looks at the item tags that the item is a part of. Truth be told, this is a horrible system. Many of the tags produce functionality that the user may not desire, such as the "guarded_by_piglins" tag. The reason it exists is because of a lack of (AFAIK) an ore dictionary in the Fabric ecosystem. I haven't thought of a better way of grouping items in an extensible, user-intuitive way. But for now I would suggest making use of the obscenely large filter inventory and even chaining the filter pipes in an OR fashion (one pipe connects to multiple filtered pipes, each one allowing opening a new path).

from ezpas.

JoshMayberry avatar JoshMayberry commented on July 24, 2024

I see. So, the flag is looking for an intersection in tags. For example, if I put gold in the filter- then anything with the tag "guarded_by_piglins" would pass through- because they both share that tag.

That makes sense. :)
I will do as you suggest with the large filters. I don't think this will be intuitively possible until fabric has some kind of ore dictionary.
Thank you for helping me understand this option a bit better. :) It was confusing, but now I understand.

from ezpas.

JoshMayberry avatar JoshMayberry commented on July 24, 2024

Just to double check, I have the the F3 debug screen shows some lines with a '#'under Targeted Block.
Those are tags (correct?). If I look at planks, they don't have any odd tags associated with them such as "#guarded_by_piglins":
image

So, this would be a safe block to use in a filter with Match Item Tag.

A gold block though should not be used in such a filter though because it has "#guarded_by_piglins" and "#beacon_base_blocks":
image

So, as long as I confirm things with the debug screen, I should be just fine using the Match Item Tag filter. For items that have odd tags, combine that filter with a chain of other filters that have every single variant of it.

Netherack would be horrible to use because it has so many tags:
image

Suggestion

What if there was a way to toggle which tags of the block I wanted to have applied, and which could be ignored? Kind of like this (the side bar would only appear if "Match Item Tag was turned on in the advanced filtering menu):
image

from ezpas.

JoshMayberry avatar JoshMayberry commented on July 24, 2024

I also think that mod tags are ignored, which is probably a good thing- unless they were toggled off by default.

For example, the mod Cotton adds the tag #strip_command to a log, as well as to diorite, but putting a log in the filter does not let diorite pass through.
image
image

Also, I do not think my F3 screen is showing all tags, because #stones does not show up for diorite- but it does if I search it in REI:
image
It also is not in the list of item tags here, so I'm not too sure.

I haven't been able to find a good mod for fabric that will let me view tags like this one for forge.

So, I built this machine. It has one of every single block in those chests (took forever to populate). I have been using this to verify what will go through the filter when set to Match Item Tag.
image
Some odd ones, both stone and netherrack let nothing pass through- not even themselves. Golden carrots let LOTS of random things pass through.

from ezpas.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.