Improve usability of commands, by using more advanced features like parameter arguments or context-aware suggestions.
Improve UX when interacting with certain commands or plugin components, by re-working the default translations.
Bring multi-language support for translations.
Migrating commands to a framework is necessary to implement some planned features much easier. Cloud v2 has been chosen because of (1) extensible API, (2) annotations module, (3) brigadier support, (3) maturity and recognition.
Translations system provided by FancyLib should make interacting with translations cleaner.
Common states (collidable, glowing, show_in_tab, turn_to_player) can now be toggled. Attribute values cannot be toggled with the current attribute system, at least not without unnecessary parsing and guessing the value type.
Equipment is no longer reset after changing NPC type to other living-entity. No modification GUI but improvements to equipment sub-command family.
TO-DO
[x] Fix all blocking issues:
[x] @Default annotation not working on flags.
[x] Location argument suggestions not working properly.
[x] Translator utility not updating the file with new contents.
[x] Translator utility throwing NPE non-existent messags, translation key should be printed instead.
[x] Port all commands the new framework.
[x] Map Cloud captions to plugin translations, preferably using exception handlers.
[x] Final tweaks and improvements to commands.
[x] Final tweaks and improvements to default translations.
[x] Write detailed changelog with all changes introduced by this PR.
[ ] Test on versions other than 1.20.6.
TO-DO (OPTIONAL, NON-BLOCKING)
[ ] Replace temporary ExceptionHandlerRegistration for LocationParser.LocationParseException with a regular ExceptionHandler. Depends on Incendo/cloud-minecraft (#70).
CHANGLOG / REFERENCE
Important / Breaking Changes
Command permissions have been renamed and now follow a fancynpcs.command.(command).(sub) format. New permissions are listed below.
Some commands have had their syntax modified to support new features. Changes are listed below.
Some sub-commands have been renamed to use snake_case instead of lowerCamelCase. These sub-commands are:
interactionCooldown ➞ interaction_cooldown
turnToPlayer ➞ turn_to_player
showInTab ➞ show_in_tab
serverCommand ➞ server_command
playerCommand ➞ player_command
Localization has been reworked.
New system supports multiple languages and these can be defined inside FancyNpcs/language/ directory.
Language can be changed globally (for all players) inside the plugin configuration (config.yml).
Currently, only english (en.yml) locale is bundled with the plugin.
Old localization file (lang.yml) is no longer used by the plugin.
I'm going to go through all commands in-game and if it looks good to me, it will be merged, so the community can test these very fancy new command system.
DESCRIPTION
Goals of this PR:
Migrating commands to a framework is necessary to implement some planned features much easier. Cloud v2 has been chosen because of (1) extensible API, (2) annotations module, (3) brigadier support, (3) maturity and recognition.
Translations system provided by FancyLib should make interacting with translations cleaner.
FIXES
Fixes https://github.com/FancyMcPlugins/FancyNpcs/issues/81
Common states (
collidable
,glowing
,show_in_tab
,turn_to_player
) can now be toggled. Attribute values cannot be toggled with the current attribute system, at least not without unnecessary parsing and guessing the value type.Fixes https://github.com/FancyMcPlugins/FancyNpcs/issues/86
Unable to reproduce the issue with this build.
Fixes https://github.com/FancyMcPlugins/FancyNpcs/issues/87
Equipment is no longer reset after changing NPC type to other living-entity. No modification GUI but improvements to
equipment
sub-command family.TO-DO
.@Default
annotation not working on flagsLocation argument suggestions not working properly.TO-DO (OPTIONAL, NON-BLOCKING)
ExceptionHandlerRegistration
forLocationParser.LocationParseException
with a regularExceptionHandler
. Depends on Incendo/cloud-minecraft (#70).CHANGLOG / REFERENCE
Important / Breaking Changes
fancynpcs.command.(command).(sub)
format. New permissions are listed below.snake_case
instead oflowerCamelCase
. These sub-commands are:interactionCooldown
➞interaction_cooldown
turnToPlayer
➞turn_to_player
showInTab
➞show_in_tab
serverCommand
➞server_command
playerCommand
➞player_command
FancyNpcs/language/
directory.config.yml
).en.yml
) locale is bundled with the plugin.lang.yml
) is no longer used by the plugin.Command Reference
/fancynpcs feature_flags
/fancynpcs feature_flags
fancynpcs.command.fancynpcs.feature_flags
/fancynpcs featureFlags
./fancynpcs reload
/fancynpcs reload
fancynpcs.command.fancynpcs.reload
/fancynpcs save
/fancynpcs save
fancynpcs.command.fancynpcs.save
/fancynpcs version
/fancynpcs version
fancynpcs.command.fancynpcs.version
/npc attribute
/npc attribute (npc) (set | list)
fancynpcs.command.npc.attribute.(sub)
list
sub-command./npc collidable
/npc collidable (npc) [state]
fancynpcs.command.npc.collidable
[state]
argument is not specified./npc copy
/npc copy (npc) (new_name)
fancynpcs.command.npc.copy
A-Z a-z 0-9 _ - /
characters./npc create
/npc create (name) [--position (x y z)] [--world (world)] [--type (type)]
fancynpcs.command.npc.create
A-Z a-z 0-9 _ - /
characters./npc displayname
/npc displayname (npc) (@none | name)
fancynpcs.command.npc.displayname
@none
instead of<empty>
./npc equipment
/npc equipment (npc) (set | clear | list)
fancynpcs.command.npc.equipment.(sub)
clear
sub-command`.list
sub-command.@none
,@hand
or valid item type as an argument./npc fix
/npc fix (npc)
fancynpcs.command.npc.fix
/npc glowingColor
/npc glowing
command./npc glowing
/npc glowing (npc) [disabled | color]
fancynpcs.command.npc.glowing
true
orfalse
, acceptsdisabled
or color as an argument.[disabled | color]
argument is not specified./npc help
/npc help [page]
fancynpcs.command.npc.help
/npc info
/npc info (npc)
fancynpcs.command.npc.info
/npc interaction_cooldown
/npc interaction_cooldown (npc) (disabled | cooldown)
fancynpcs.command.npc.interaction_cooldown
/npc interactionCooldown
.2min
. Supported units:ms
s
min
h
d
mo
y
/npc list
/npc list [--type (type)] [--sort (sort)]
fancynpcs.command.npc.list
/npc message
/npc message (npc) (add | set | remove | clear | list | send_randmly)
fancynpcs.command.npc.message.(sub)
@none
instead of<none>
./npc move_here
/npc move_here (npc)
fancynpcs.command.npc.move_here
/npc moveHere
./npc move_to
/npc move_to (npc) (x) (y) (z) [world] [--look-in-my-direction]
fancynpcs.command.npc.move_to
/npc teleport
.--look-in-my-direction
presence flag that makes NPC turn in direction player is currently standing at./npc nearby
/npc nearby [--radius (radius)] [--type (type)] [--sort (sort)]
fancynpcs.command.npc.nearby
list
sub-command but only lists NPCs in player's world./npc player_command
/npc player_command (npc) (add | set | remove | clear | list)
fancynpcs.command.npc.player_command.(sub)
/npc playerCommand
./npc remove
/npc remove (npc)
fancynpcs.command.npc.remove
/npc server_command
/npc server_command (npc) (add | set | remove | clear | list)
fancynpcs.command.npc.server_command.(sub)
/npc serverCommand
./npc show_in_tab
/npc show_in_tab (npc) [state]
fancynpcs.command.npc.show_in_tab
/npc showInTab
.[state]
argument is not specified./npc mirrorSkin
/npc skin
command./npc skin
/npc skin (npc) (@none | @mirror | name | url)
fancynpcs.command.npc.skin
@none
flag.@mirror
flag./npc teleport
/npc teleport (npc)
fancynpcs.command.npc.teleport
/npc move_to
command./npc turn_to_player
/npc turn_to_player (npc) [state]
fancynpcs.command.npc.turn_to_player
/npc turnToPlayer
.[state]
argument is not specified./npc type
/npc type (npc) (type)
fancynpcs.command.npc.type