cannot get regex filter to work very well
boneskull opened this issue ยท 2 comments
Minecraft Version
1.16.4
Forge Version
35.1.13
Mod Version
7.2.0-39
Describe your problem, including steps to reproduce it
I'm attempting to have the Player Module pull raw shards from ElementalCraft from my inventory. There are four, and the display names are Raw Air Shard, Raw Earth Shard, Raw Fire Shard and Raw Water Shard. I created a Regex filter containing the following, which I would expect to work:
^raw.+shard$
The following does work, but is not what I want (given there are other things called "shards"):
shard$
In fact, using the same example regex in the documentation does not work:
\bore$
Nor does:
\bore
(In these examples, the filters contain only a single pattern)
I'm not sure what is broken here exactly, but I have not had much luck with the regex filter other than matching the beginning and end of names (e.g., log$
).
Any other comments?
Here's my module config, in case I messed up something there:
Yeah, there is a problem here, and it's a bit difficult to properly fix. When the filter was first created (back in 1.10 days), it worked on the display name of the item. But, since it runs server-side, you can't rely on the item's display name being the expected value (since language is a client-side setting, and the server has no concept of the player's current language). So that was a mistake in the design of the filter.
More recent versions of the mod actually work on the item's registry name, but that is not well documented, and something I need to fix in the manual. The registry name is what's shown by F3+H, e.g. for Stone, the full registry name is minecraft:stone
, and the filter will match on stone
(i.e. the part after the :
).