Make no-graves command messages configurable in grave.yml - #257
Open
v4r1n wants to merge 1 commit into
Open
Conversation
Add two new configurable message keys under settings.default.default.message: - no-graves: shown when a player has no graves (self context) - no-graves-other: shown when a player has no graves (other player context, supports %name%) Replace 7 hardcoded ChatColor.RED strings in GravesCommand with EntityManager.sendMessage() calls so messages respect the configured prefix, support localization, and can be silenced by setting the key to empty. Bump CURRENT_CONFIG_VERSION 25 to 26 so ConfigUpdater merges the new keys into existing server configs on next restart. Admin purge responses (commandSender paths) remain hardcoded — they target CommandSender (console-capable) where EntityManager.sendMessage is Player-only.
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.
Summary
This PR moves the hardcoded "no graves" command responses into the configurable message system under
settings.default.default.messageingrave.yml, so server owners can translate and restyle them like every other message the plugin sends.Right now
GravesCommandwrites these strings inline withChatColor, which bypassesmessage.prefix, ignores per-permission overrides, and leaves no way to localize them.Motivation
Server owners already translate the
message:section (for exampleempty: "You don't have any graves."). The command responses below stay hardcoded in English, so a translated server still shows English text in a different prefix style. This change makes them behave consistently with the rest of the message system.Changes
New message keys (
grave.yml→settings.default.default.message)%name%resolves to the target player's name via the existingEntityManager.sendMessage(String, Entity, String name, Location, List<String>)overload.GravesCommand.javaSelf — "You have no graves." (virtual + teleport paths):
Other player — "<name> has no graves." (GUI + virtual + teleport paths):
ConfigManager.javaBump
CURRENT_CONFIG_VERSIONsoConfigUpdatermerges the new keys into existing server configs on upgrade.ConfigUpdaterpreserves admin edits and only adds missing keys.Behavior notes
message.prefixinstead of the inline☠ »format, matching every other plugin message.EntityManager.sendMessage).Out of scope
This PR intentionally leaves the admin purge responses hardcoded — "No graves found for offline player ..." and "No graves found for UUID ...". Those commands respond to a
CommandSenderthat can be the console, whereasEntityManager.sendMessageonly delivers to aPlayer. Routing them through the message system would silently drop console output and break consistency with the surrounding admin feedback, so they deserve a separate change if desired.Test plan
/graves teleportand/graves virtualwith no graves → showsno-graves/graves teleport <player>//graves virtual <player>/ GUI-other for a player with no graves → showsno-graves-otherwith correct nameno-gravesto""→ no message sends