Refine the auto pickup toggle and restore the prefix style system - #4
Merged
Merged
Conversation
Guarding the subcommand with autotreechop.autopickup made Lamp drop it from tab completion and answer "unknown command" for anyone missing the node, so a player whose permission had been revoked could not tell the feature apart from one that does not exist. Guard on autotreechop.use like the other self-service subcommands and check the auto pickup node in the body, so the refusal is an explicit no-permission message.
When enable-auto-pickup is false the feature is off for everyone, so answering "you do not have permission" pointed the player at a permission node that would not have helped. Check the config flag first and report that the server has auto pickup disabled.
Auto pickup is a paid feature, so defaulting the node to true handed it to everyone as soon as a server turned enable-auto-pickup on. Default it to op, the same tier autotreechop.vip already uses, so it has to be granted to the ranks that paid for it.
en and zh were rewritten with hardcoded colours in 0602c28, which took them out of the styles.properties system while de/ja/ms/ru stayed in it, and the later locales copied the hardcoded form. Editing prefix in styles.properties therefore did nothing for most of the server's players. Wrap every chat message in all ten locales in <prefix> or <prefix_negative> so the prefix and the colour scheme are defined once in styles.properties. consoleName is a placeholder value rather than a message, and the four about lines are one block where a repeated prefix would be noise, so both keep raw MiniMessage. Default styles.properties values are unchanged, so the plugin still renders exactly as before until a server puts a prefix in front of {slot}; its comments now explain the two tags. Also drop the trailing full stop from every zh message, keeping the one that separates two sentences inside the three confirmation prompts.
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.
Follow-up to #3, which added
/atc autopickupand the per-playerautoPickupEnabledcolumn. This PR fixes how that command behaves when it cannot be used, changes who gets the feature by default, and repairs the message styling system it exposed.Auto pickup command
Show a refusal instead of hiding the command. Guarding the subcommand with
@CommandPermission("autotreechop.autopickup")made Lamp drop it from tab completion and answer "unknown command" for anyone missing the node, so a player whose permission had been revoked could not tell the feature apart from one that does not exist. It is now guarded onautotreechop.uselike the other self-service subcommands, with the auto pickup node checked in the body so the refusal is an explicit message.Check the server-wide flag first. When
enable-auto-pickupis false the feature is off for everyone, so answering "you do not have permission" pointed the player at a permission node that would not have helped. The order is now: config flag → player check → permission → toggle.Stop granting
autotreechop.autopickupto everyone. Auto pickup is a paid feature, and defaulting the node totruehanded it to every player as soon as a server turnedenable-auto-pickupon. It now defaults toop, the same tierautotreechop.vipalready uses.Message styling
enandzhwere rewritten with hardcoded colours in 0602c28, which took them out of thestyles.propertiessystem whilede/ja/ms/rustayed in it, and the locales added later copied the hardcoded form. Editingprefixinstyles.propertiestherefore did nothing for most of a server's players.Every chat message in all ten locales is now wrapped in
<prefix>(success and information) or<prefix_negative>(refusals, limits and warnings), so the prefix and the colour scheme are defined once. Two deliberate exceptions keep raw MiniMessage:consoleName, which is a placeholder value rather than a message, and the fourabout*lines, which are one block where a repeated prefix would be noise.The default
styles.propertiesvalues are unchanged, so the plugin renders exactly as before until a server puts a prefix in front of{slot}; only its comments changed, to explain the two tags.README.mdgains a short "Message styling" section.The trailing full stop is also dropped from every
zhmessage, keeping the one that separates two sentences inside the three confirmation prompts.Notes for deployment
TranslationManager.updateTranslationFiles()only appends missing keys and never overwrites existing values, andstyles.propertiesis written withsaveResourceIfNotExists. Servers that already haveplugins/AutoTreeChop/lang/will keep their current files — those need to be deleted (after backing up any customisation) to pick up the reworded messages.Locales that were on
<prefix>already renderedusageandblocks-brokenin the positive colour anddisabledin the negative one; the locales converted here now match, so those messages change from grey and yellow to green and red.Testing
./gradlew build -x testandspotlessCheckpass.StyleRegistryexpansion algorithm was run over the rewritten locale files with both the shippedstyles.propertiesand a prefixed one, confirming every message resolves throughprefix→text→positive→<green>(and the negative chain), that nested tags such as<white>{timeout}s</white>survive, and thatconsoleNameand the about block are untouched.Generated by Claude Code