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

Fix for sender/receiver id's failing if spaces in them #43

Closed elnewfie closed 1 year ago

elnewfie commented 1 year ago

While using the plugin, I realized that if a world has spaces in the name, it would have errors looking up the sender/receiver ID. This was due to the way onCommand parses the commands into separate arguments based on the spaces. This fix uses URLEncode/URLDecode to ensure the IDs are passed around in commands in a single argument.

Why URL encode/decode? I could have just just merged all arguments to rebuild the ID, but this means the very last argument must be the ID, or it wont work. Using URL encoding the order of arguments becomes irrelevant, and future commands wont have to solve this problem either.