Skip to content

Refine the auto pickup toggle and restore the prefix style system - #4

Merged
awdrgyj8 merged 4 commits into
masterfrom
claude/auto-collect-toggle-design-xxsvdy
Aug 31, 2026
Merged

Refine the auto pickup toggle and restore the prefix style system#4
awdrgyj8 merged 4 commits into
masterfrom
claude/auto-collect-toggle-design-xxsvdy

Conversation

@awdrgyj8

Copy link
Copy Markdown
Member

Follow-up to #3, which added /atc autopickup and the per-player autoPickupEnabled column. 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 on autotreechop.use like 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-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. The order is now: config flag → player check → permission → toggle.

Stop granting autotreechop.autopickup to everyone. Auto pickup is a paid feature, and defaulting the node to true handed it to every player as soon as a server turned enable-auto-pickup on. It now defaults to op, the same tier autotreechop.vip already uses.

Message styling

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 locales added later copied the hardcoded form. Editing prefix in styles.properties therefore 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 four about* lines, which are one block where a repeated prefix would be noise.

The default styles.properties values 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.md gains a short "Message styling" section.

The trailing full stop is also dropped from every zh message, 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, and styles.properties is written with saveResourceIfNotExists. Servers that already have plugins/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 rendered usage and blocks-broken in the positive colour and disabled in 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 test and spotlessCheck pass.
  • The StyleRegistry expansion algorithm was run over the rewritten locale files with both the shipped styles.properties and a prefixed one, confirming every message resolves through prefixtextpositive<green> (and the negative chain), that nested tags such as <white>{timeout}s</white> survive, and that consoleName and the about block are untouched.
  • Key sets of all eleven properties files were diffed against the base branch: values only, no keys added or lost.

Generated by Claude Code

claude added 4 commits August 31, 2026 12:17
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.
@awdrgyj8
awdrgyj8 merged commit 7b965d2 into master Aug 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants