FancyMcPlugins / FancyNpcs

FancyNpcs is a simple, lightweight and fast npc plugin using packets
https://modrinth.com/plugin/fancynpcs
MIT License
98 stars 23 forks source link

commands and translations overhaul #105

Closed Grabsky closed 1 month ago

Grabsky commented 2 months ago

DESCRIPTION

Goals of this PR:

  1. Improve usability of commands, by using more advanced features like parameter arguments or context-aware suggestions.
  2. Improve UX when interacting with certain commands or plugin components, by re-working the default translations.
  3. 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.

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

TO-DO (OPTIONAL, NON-BLOCKING)


CHANGLOG / REFERENCE

Important / Breaking Changes

  1. Command permissions have been renamed and now follow a fancynpcs.command.(command).(sub) format. New permissions are listed below.
  2. Some commands have had their syntax modified to support new features. Changes are listed below.
  3. Some sub-commands have been renamed to use snake_case instead of lowerCamelCase. These sub-commands are:
    • interactionCooldowninteraction_cooldown
    • turnToPlayerturn_to_player
    • showInTabshow_in_tab
    • serverCommandserver_command
    • playerCommandplayer_command
  4. 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.

Command Reference

/fancynpcs feature_flags

/fancynpcs reload

/fancynpcs save

/fancynpcs version

/npc attribute

/npc collidable

/npc copy

/npc create

/npc displayname

/npc equipment

/npc fix

/npc glowingColor

/npc glowing

/npc help

/npc info

/npc interaction_cooldown

/npc list

/npc message

/npc move_here

/npc move_to

/npc nearby

/npc player_command

/npc remove

/npc server_command

/npc show_in_tab

/npc mirrorSkin

/npc skin

/npc teleport

/npc turn_to_player

/npc type

OliverSchlueter commented 1 month ago

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.