NewAgeCZ / CommandHook

Minecraft plugin for Bukkit API compatible servers. Vanilla selector parsing for non-vanilla commands.
GNU General Public License v3.0
7 stars 4 forks source link

This plugin matches the selectors too greedily #7

Closed bergerkiller closed 1 week ago

bergerkiller commented 4 months ago

Your @p/@e/etc. pattern matcher does not have a terminator, as a result it is also parsing TrainCarts' @ptrain selector. Is it possible you can adjust the regex here so that if the @p/etc. is followed by an alphanumeric character it doesn't match it?

Positively matching an open space, comma, ;, etc is also possible but might break compatibility with more plugins than simply disallowing "@pa" and such.

NewAgeCZ commented 3 months ago

I have implemented the changes you proposed and made some testcases for it. This took a bit diverge from original premise of "vanilla selector parsing for non-vanilla commands" as those would treat it exactly like it used to do: minecraft:say @ptrain would return _NewAgetrain. I have released the fix in the latest 3.0.0, so please let me know if it works for you.

Thank you for your report submission and suggested fix!

bergerkiller commented 1 week ago

User reported the selectors work fine now, thanks for fixing! Sorry for the delay btw, hadn't monitored this in a while