Skip to content

3.0.0-SNAPSHOT

Pre-release
Pre-release
Compare
Choose a tag to compare
@NotMyFault NotMyFault released this 15 Oct 14:25
c00f4ee

馃挜 3.0.0 switches from a custom command framework to cloud.

If you notice, a command doesn't work, acts differently compared to 2.x or something else may be wrong, don't hesitate to file an issue.

General Command Management

I have opted to use the annotations extension of the cloud command system. In my opinion, this is better suited to the current brush format handling which is all done inside brush classes.

Executors have been kept and brush & performer command are still handled inside their classes.

  • Snipe class has been extended for a usage as a commander, because FAVS relies on a lot on this class.
  • CommandRegistry is the main place for the whole handling behind the scenes. Otherwise, commands are registered as usually done in cloud, with some specific annotations when needed.

SniperCommander class is the commander to use with cloud command system. If the player exists, it returns its sniper. Otherwise, it returns a simple SniperSender, similar to CommandSender.

Command Manager

FAVS uses the paper command manager, when available, to enjoy some improvements. Falls back to bukkit command manager otherwise.

  • Async tab-completions are enabled if available.
  • Snipe, PerformerSnipe & Toolkit classes are registered into the injector in order to be injected in command methods.
  • Command exceptions are adapted and customized with the FAVS message syntax.

Command Post-Processor

FAVS requires the command post-processor ins order handle specific FAVS behavior.

  • Handles the @RequireToolkit annotation, makes sure the toolkit is available and the value stored.
  • Handles the @DynamicRange annotation, used to define a range from non-constant variables, using reflection.
  • Prepares the brush & performer when needed, their Snipe and stores them.

Annotations & Parser

FAVS uses some annotations to facilitate development, based on common rules and behaviors.

  • Handles the @RequireToolkit annotation, modifies the command meta.
  • Handles the custom command execution method handler, which should differ for brush & performer. Cloud commands are designed to live in a class instance, this is not suitable to the current management of brush & performer. I have opted for a custom execution method which uses the brush & performer instance from the execution context instead of the base instance. This avoid extra parameters for each command method.

Arguments

FAVS needs a lot of custom arguments for either factories, registries, custom types, custom needs, etc.

Suggestions & parsers are also declared via annotations in custom classes.

Other Changes

  • Fixes #286
  • Fixes #288
  • Fixes #291
  • Fixes #294
  • Fixes #305
  • Re-add meteor as an alias of the comet brush.

  • All classes related to internal command managing from VS have been removed.
  • FastAsyncVoxelSniper class has been removed. As far as I know, this class was useless and is now for sure.
  • Some classes and methods have been added or refactored, but the overall code base is the same to try keeping maximum compatibility.
  • Some translations have been reorganized or removed.
  • Some code format has been modified, there will be another pull request next year hopefully to unify comments format.
  • Improvements to brush properties loading. Previously, all aliases were loaded, subsequently loading the same brush several times.
  • Modern switch syntax has replaced old ones.
  • General improvements.

Known Problems:

### 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](https://github.com/IntellectualSites/.github/blob/main/CONTRIBUTING.md).