Repository navigation
3.9.0: update check, decimal health, health colors, off by default, Modrinth and Hangar uploads - #79
Merged
Merged
Conversation
…tion
- Update Check: asks spigotmc.org once a day for the latest version number.
Logs a new version and tells players with ActionHealth.Update on join.
- Health Decimals: up to 3 decimals for health numbers. A living entity no
longer shows 0 health.
- {healthcolor}: a color from Health Colors for the health that is left.
- Enabled By Default: players can opt in with /actionhealth toggle.
toggles.yml now keeps the players who turned it on, too.
- Reload Message and Help Message are configurable.
- Release workflow: uploads the release jar to Modrinth and Hangar when
their secrets exist, and can upload an existing tag by hand.
- Tag instructions use --cleanup=verbatim, so "###" headings stay.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01T5MqrCm9Pp5CcLQ15xzmxD
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01T5MqrCm9Pp5CcLQ15xzmxD
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.
The first part of the plan to win back servers. bStats shows 190 servers, down from about 2,250 in 2022. 65% of them still run 3.5.9, which our tests show sends no action bar on 1.21 and later. This PR helps owners find out about new versions, and it adds the small features that owners asked for on Spigot. It also makes each release upload to Modrinth and Hangar. The version is 3.9.0.
New features
support/UpdateChecker.javaasksapi.spigotmc.org/legacy/update.php?resource=2661once a day, starting 5 seconds after the plugin starts. The request runs on a background thread (the async scheduler on Folia).ActionHealth X is available. This server runs Y. Download it at <Spigot page>.ActionHealth.Update(op by default) get theUpdate Message2 seconds after they join.User-Agent: ActionHealth/<version>header. The system propertyactionhealth.updateurlreplaces the URL, for tests.Update Check: trueis the default, also in old configs. The header of the added options now says "except Update Check", because this option changes what the plugin does.Health Decimals(0 to 3) applies to{health},{maxhealth},{absorption}and{opponentlastdamage}. Extra decimals are cut off, so 19.99 does not show as full health. The separator is always a dot. Requested in a May 2022 review.{healthcolor}takes the color fromHealth Colorsfor the percentage of health left. Requested in June 2022.Enabled By Default: false, players see nothing until they run/actionhealth toggle.toggles.ymlnow has anenabledlist next totoggled. Both choices are saved, so a change of the default does not turn a saved choice around. Requested in July 2023.Reload MessageandHelp Messagereplace the hard-coded text.Bug fixed
0health, because the code cast health to an integer.{health}now shows at least the smallest step (1, or0.1with 1 decimal).{percenthealth}shows at least1.Release workflow
publishjob runs after the GitHub release. It downloads the jar and the release text from the GitHub release, so all sites get the same file. Then it runs.github/scripts/publish-modrinth.shandpublish-hangar.sh.MODRINTH_TOKENandHANGAR_TOKEN. Without a secret, the job writes a notice and skips that site.workflow_dispatchwith ataginput uploads an existing release again. If a site already has the version, the script skips it.MINECRAFT_VERSIONS: 1.8-26.3in the workflow sets the tested range. The Modrinth script lists every Minecraft release in it (75 versions). Hangar takes the range as it is.git tag -a <version> --cleanup=verbatim -F notes.md. Without--cleanup=verbatim, git removed the###headings from the 3.8.0 and 3.8.1 tag messages.Tests
HealthFormatTest: decimals are cut off, the separator is a dot with a German locale, a living entity never shows 0, and the color thresholds.UpdateCheckerTest: version comparison (3.10.0 is newer than 3.9.2), and an answer that is not a version is ignored.ToggleStoreTest: off by default, saved choices after a restart, and a change of the default.ConfigUpdaterTest: the header namesUpdate Check.health-color:10/10is green at full health.decimals:Cow: 10.0/10.0.update-check: run.sh makes the check read99.0.0from a local file. The log names it, and an operator bot gets the message when it joins.reload-message: an operator bot gets theReload Message.default-off: a new bot gets no action bar until it runs/actionhealth toggle.consumeandaction-tagsin the first run: Bot2 drank the potion, but Bot1 got no message. I ran 26.3 two more times, and both runs passed. This PR does not change the action code, and the same check passes on Paper 26.3. I did not find the cause, so the compat README records it as unknown.api.spigotmc.orgreturns3.8.1. A Java 8 (1.8.0_504)URLConnectionwith the same timeouts and User-Agent reads it too.Not tested
InitialVersionDatasource and the Hangar OpenAPI spec. The first real run will be the 3.9.0 release, or a manual run for 3.8.1.🤖 Generated with Claude Code
https://claude.ai/code/session_01T5MqrCm9Pp5CcLQ15xzmxD