flokol120 / Spigot-Item-Chest-Sorter

A Spigot/Paper minecraft plugin to sort your messy items into separate chests | 💯% written in Kotlin
GNU General Public License v3.0
5 stars 6 forks source link

Prioritize Regex [Suggestion] #36

Closed nefus8 closed 2 years ago

nefus8 commented 2 years ago

Hello,

I tried to group some items so they go in the same chest with sets and regex. But I want for example all the stone items to go on a stone chest, so I've added a regex : '.*stone.*' but I want the glowstone to go on the nether chest, so in the nether sets, I wrote 'glowstone'.

But glowstone goes into the stone chest, so I would like to suggest a prioritisation of the regex, so that if there is another regex placed above in the yaml file, this regex will be executed first, or if a single item is set in a group, we prioritse the item instead of the regex.

So to solve my probleme, there would be two solutions:

Solution 1

# glowstone directly written as an item so it's going in the nether chest.
 - ['.*nether.*', '.*quartz.*', glowstone, glowstone_dust, magma_block, soul_sand, shroomlight, soul_soil, '.*blackstone.*']
 - ['.*stone.*']

Solution 2

# glowstone regex placed above stone regex so it's going in the nether chest.
 - ['.*nether.*', '.*quartz.*', '.*glowstone.*', magma_block, soul_sand, shroomlight, soul_soil, '.*blackstone.*']
 - ['.*stone.*']
flokol120 commented 2 years ago

Strange from the code I looked at, it should already match on the first set in the yml file :thinking: But I will take a deeper look into it and implement the second solution you suggested.

flokol120 commented 2 years ago

@nefus8 I just tested this in my test world and it was working as expected for me. What item is in the item frame of the two chests?