PlotSquared
PlotSquared copied to clipboard
fix: correct tab completion for `/plot flag set <flag> <value>`
Overview
Fixes #3028
Description
This PR fixes the incorrect tab completion behavior for the command /plot flag set <flag> <value>
Submitter Checklist
- [x] Make sure you are opening from a topic branch (/feature/fix/docs/ branch (right side)) and not your main branch.
- [x] Ensure that the pull request title represents the desired changelog entry.
- [x] New public fields and methods are annotated with
@since TODO. - [x] I read and followed the contribution guidelines.
the tabcompletion should probably get a small refactor - if you want to, you can adjust those small things:
- don't call Arrays.asList for every tab completion (could be a Set which is initialized once - or compare constants directly)
- potentially check args.length before comparing against the list (not sure if the JVM optimizes that either way)
- the abbreviations don't seem to tab-complete (e.g.
/p f set->/p f s) - all possible abbreviations are listed on line 252
Still new to this so I just did the third suggestion, should be fine like that.