-
Notifications
You must be signed in to change notification settings - Fork 303
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ACF Command rework - Done! #2514
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. |
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 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 ...
)./mv
that will show the plugin's version and help command./mv bed
command (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 list
and/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 separateself
andother
permission 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 byvalidateWorld
above 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
,-s
etc... 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 Generator
OptionalFlag
: May not need a value.NoValueFlag
: Do not need any value. i.e.-n
contexts:
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
,filter
which 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 2
in-game/mvnp listall
in-console/mv config list spawn
in-gameOther changes:
TODO list:
You can get the test builds at https://www.benergy10.dev/