Essentials
Essentials copied to clipboard
Introduce command trees; improve Commandessentials
Information
This PR closes an internal goal.
Details
Proposed feature:
This implements two separate features (may be split into separate PRs later down the line):
- [x] Introduce command trees, which allow for nested subcommands to be declared and parsed effectively.
- Goals: lightweight, incrementally adoptable across new and existing commands as necessary
- Trees consist of a root node, literal nodes and execute nodes
- No parsing of argument types is implemented at present
- Possibly worth exploring cloud/another tree command lib instead of rolling our own
- [ ] Provide helper methods on command exec context to replicate
EssentialsCommand - [ ] Think about command node impl in more depth
- [ ] Rewrite
/essentials, splitting complex subcommands into separate classes- [x] Replace
runandtabCompleteimpls with tree - [ ] Refactor existing subcommand functions
- [ ] Split out dump into own class (possibly a separate refactor on its own?)
- [x] Replace
Environments tested:
OS: Windows 11 22H2
Java version: Eclipse Temurin 17.0.6
- [x] Most recent Paper version (1.19.4, git-Paper-547)
- [ ] CraftBukkit/Spigot/Paper 1.12.2
- [ ] CraftBukkit 1.8.8
Demonstration:
This PR should preserve all existing functionality of /essentials.
Dumb question maybe, but wouldn't it be possible to use Mojang's brigadier library for this purpose?
Dumb question maybe, but wouldn't it be possible to use Mojang's brigadier library for this purpose?
Using that severely limits the flexibility we have and reduces the code quality.