ACF Command rework - Done!#2514
Closed
benwoo1110 wants to merge 184 commits into
Closed
Conversation
(mocking test are completely broken rip)
|
Is this no longer being worked on? Because, as an amateur developer, this looks cool and it looks like it was close to being completed. |
Member
|
We don't have the free time that we used to have, and this is a really big change that we need to test and review. So in a way, yes, work has stopped on this, since it hasn't been touched in quite some time. However, that doesn't mean it won't continue, it just means that for the time being, development is paused. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR moves the entire multiverse commands system to Annotation Command Framework (ACF) made by Aikar. I have been working on this for quite a while now, and its almost done!
Features:
/mvp ...)./mvthat will show the plugin's version and help command./mv bedcommand (replacement for previously broken sleep command). Basically, just teleports you to respawn point./mv modify list [world]command to display the available property values./mv who,/mv whoall,/mv gamerule list,/mv config listand/mv anchors list./mv help <command>command, with per args explanation and tab-complete.Command changes:
[old => new : reason]
/mv version [-p|-h|-g]=>/mv version [pastebin|hastebin|pastegg]: Make paste type more readable./mv coord=>/mv coord [player]: View another players location, with separateselfandotherpermission node./mv config -list=>/mv config list [filter]/mv config <property> <value>=>/mv config set <property> <value>: Clearer command hierarchy./mv gamerules [world]=>/mv gamerule list [world] [filter]/mv gamerule <property> <value> [world]=>/mv gamerule set <property> <value> [world]: Clearer command hierarchy./mv modify add <value> <property> [world]=> mv modify add [world] : Align with the rest of the modify commands./mv purge all ...=>/mv purgeall ...: Possiblilty of a world named all, and provides a clearer structure./mv who --all=>/mv whoall [filter]: Same reason as purge command./mv who <worldname>=> `/mv who [filter]/mv anchors <name>=>/mv anchors create <name>/mv anchors=>/mv anchors list [filter]/mv anchors -d <anchor>=>/mv anchors delete <anchor>: Make anchor command syntax a lot clearer.Important things to note:
-styled flags in favour of a proper structure like shown in the above anchor command. However that being said, I will definitely retain is the world generation flags./mv <subcommand> [actions]. EXCEPT for the following that I have retained as I feel it's used very often:/mvsetspawn: alias for/mv setspawn/mvspawn: alias for/mv spawn/mvtp: alias for/mv teleport?behind a command to see its usage.API Changes:
(changes that effects existing API, does not include new commandTools classes) [Symbols: ~ change, + add, - remove]
~ Core#getMVCommandManager: Change to new Command class in favour of the old command handler.~ PermissionsInterface: Moved from old command handler package, as it's still needed in some code.+ MVWorldManager#getAvailableWorldGenerators: Use for listing generators and tab complete -g flag+ MVWorldManager#isValidWorld: Use to get better invalid messaging and tab-comeplete for world commands.+ MVWorldManager#validateWorld: Use to get better invalid messaging for world commands.+ WorldValidationResult: Enum returned byvalidateWorldabove to indicate different reason of validation output.+ MultiverseWorld#getAllPropertyTypes: Used for tab completing available set property values.+ LocationManipulation#strAxis: Show shorter location without pitch and yaw, used by anchor list command.+ DestinationFactory#getPlayerAwareDestination: Able to parse destination that require player's attributes.+ DestinationFactory#getIdentifiers: Used for tab-complete+ DestinationFactory#getPermissions: Used for teleport command permissions checking.~ DestinationFactory: Some changes to remove code that uses old command handler.~ DestinationFactory#registerDestinationType: Some changes to remove code that uses old command handler.- FancyText: Use new ContentDisplay classes instead.New commandTools Package:
Contains all the new classes that handle commands stuff is some way ;)
CommandManagers classes:
MVCommandManager: The heart of the MV's command handling.MVCommandCompletions: Define tab-complete methodsMVCommandContexts: Parse args into objectsMVCommandConditions: Validdate command inputs.flag Package:
Define each world flags such as
-g,-setc... with methods to do tab-complete suggestions and parsing of value.MVFlags: Contains all the world flags by implementing the abstract flag classes.Flag: Requires a value. i.e.-g GeneratorOptionalFlag: May not need a value.NoValueFlag: Do not need any value. i.e.-ncontexts:
PlayerWorld: Store parsed Player and the MultiverseWorld it is in.WorldFlags: Store parsed world flags settings.PageFilter: Store parsed page and filter, both optional parameters.queue Package:
Confirm commands before running with an expiry duration. Now uses runnable in favour of old implementation.
CommandQueueManager: Manages adding, running and expiry of commands.QueuedCommand: Single command instance in queue.DummyCommandBlockSender: Use so that commands queued by a command block and be confirmed by another command block.display Package:
Customisable display for list and info commands.
Main abstract classes:
ContentDisplay: Builder class to set up the attributes such assender,header,filterwhich is built into a ShowRunnable.ShowRunnable: Do creating of items and displaying it to the sender.ContentCreator: Supplier that creates the items to show.ContentFilter: Filter each item based on regex matching.ColorAlternator: Flip between 2 colors for some cooler lookInline implementation: Showing of each item separated with comma.
InlineDisplay: Further abstraction to have common attributes for different inline type display.KeyValueDisplay: For map, such as config keys.ListDisplay: For list, such a available generators.ShowInline: Further abstraction of ShowRunnable with some shared attributesShowKeyValue:ShowList:Page implementation: Showing of each item on a new line with pages.
PageDisplay: Builder for a list of items with additional paging attributes.ShowPage: Further abstraction of ShowRunnable with some shared attributes for paging.ShowAllPage: Console doesn't need paging, so just show all the itemsShowSelectedPage: Display part of the content based on the page specified.Sample code:
Screenshots for some sample outputs:
/mv list 2in-game/mvnp listallin-console/mv config list spawnin-gameOther changes:
TODO list:
You can get the test builds at https://www.benergy10.dev/