Skip to content

3.8.0: Folia support, bug fixes, tests and CI - #77

Merged
zeshan321 merged 1 commit into
masterfrom
feat/improvements
Oct 3, 2026
Merged

zeshan321 merged 1 commit into
masterfrom
feat/improvements

Conversation

@zeshan321

Copy link
Copy Markdown
Owner

Summary

This PR adds Folia support, fixes four bugs, makes the look check cheaper and adds unit tests, CI server tests and a release workflow. The version is now 3.8.0.

Bugs

  • Health on hit changed combat damage. The hit listener wrote the final damage to the entity with setLastDamage, for {opponentlastdamage}. The server uses that value to calculate the damage of a second hit during the invulnerability time. The plugin now keeps the value in its own map.
  • One bad config line stopped the plugin from loading. These now log a warning and skip the line:
    • An empty Upper Limit Health. The config comment told owners to do this.
    • A Name line without =.
    • An unknown action type under Action.Events.
  • UUIDs were compared with ==. This worked only because Bukkit returns the same object each time. The code now uses equals.
  • The line of sight used the wrong distance. The check walks along the look direction. It stopped after the distance from the player's feet to the target's feet. Now it stops at the point where the look ray hits the hitbox, and it tests each solid block exactly.

Performance

  • The look check runs every 2 ticks by default, not every tick. Existing configs keep their CheckTicks value.
  • The look check sends the same message again only after 1 second. The client shows a bar for about 3 seconds, so the bar does not fade. Each check still restarts the Display Time timer.
  • The getName method is cached for each entity class.

Server owners

  • Config updates. Options that are missing from config.yml are added at the end of the file, with their comments. The rest of the file does not change. Bukkit already used the jar values for missing options, so the added values change nothing. A unit test checks this for every option. The exception is Absorption Icon, which is added as "", because the plugin reads it with its own default.
  • Commands. Tab completion, a no permission message (No Permission in the config) and a new ActionHealth.Toggle permission. All players have that permission by default. plugin.yml now lists all three permissions. The defaults are the same as before.
  • Folia. utils/Scheduler.java uses the Folia schedulers through reflection. The look check for each player runs on the region thread of that player. Shared data uses thread-safe collections. bStats 3.2.1 replaces the copied Metrics class, because it also runs on Folia.
  • Toggle choices. Remember Toggle now saves to one toggles.yml, read once at startup. Before, the plugin read one file for each player on every join. The old players folder is moved into toggles.yml one time and renamed to players-old.
  • Removed ShowArmorStand from the default config. The plugin never read it. Armor stands stay hidden, as before.

Code and tests

  • Removed about 150 lines of unused targeting code and the 329-line FileHandler.
  • 33 JUnit tests: health icons, color conversion, ray and block math, the config update and the toggle store.
  • compat/e2e/ci.sh runs the bot tests on Spigot 1.8.8, Spigot 1.21.11, Paper 26.3 and Folia 1.21.11. A new e2e job in the build workflow runs it.
  • .github/workflows/release.yml creates the GitHub release from an annotated version tag. It checks that the tag matches build.gradle.
  • An npm override moves uuid to 11.1.1 in the test dependencies. This fixes Dependabot alert 1.
  • New bot checks: config-update, last-damage and permission. The display-time check now counts from the moment the bot looks away.

Not in this PR

  • No /ah alias. Auction house plugins often use /ah. ActionHealth loads early in alphabetical order, so it could take that command from them.

What the tests do not cover

  • The last-damage check proves that {opponentlastdamage} works. It does not prove the combat fix. A cow has no armor, so the old value and the new value are the same. No test hits an entity twice during its invulnerability time.
  • The line of sight change has unit tests for the math. No bot test has a block that only the new distance finds.

Test results

All on the jar from commit b2927f5 (SHA-256 2f681fbc...505dc1):

  • Spigot: 27 versions from 1.8 to 26.3, with 11 checks each: pass.
  • Paper: 1.8.8, 1.20.6, 1.21.11 and 26.3: pass.
  • Folia: 1.21.11 and 26.2: pass. For comparison, Folia does not load 3.7.1. It logs "not marked as supporting Folia".
  • Plugins: WorldGuard 6.1, 6.2.2, 7.0.15 and 7.0.19, PlaceholderAPI 2.12.3 on 1.8.8 and 26.3, ModelEngine R3.1.11 on 1.20.4: pass.
  • Linkage check: 68 of 68 spigot-api versions: pass.
  • Unit tests: 33 of 33: pass.
  • CI: build and the new e2e job: pass.

🤖 Generated with Claude Code

Bugs:
- Do not write the last damage to the entity. The server uses that value
  to calculate the next hit. Keep it in the plugin for {opponentlastdamage}.
- Skip a bad config line with a warning. Before, an empty "Upper Limit
  Health", a Name line without " = " or an unknown action type stopped
  the plugin from loading.
- Compare UUIDs with equals.
- Measure the line of sight from the eye to the point on the hitbox.

Performance:
- Check the look target every 2 ticks by default, not every tick.
- Send the same look message again only after 1 second.
- Cache the getName method for each entity class.

Server owners:
- Add missing options to config.yml at the end of the file, with their
  comments. Bukkit already used the jar values for missing options.
- Add tab completion, a no permission message, the ActionHealth.Toggle
  permission and a permissions block in plugin.yml.
- Support Folia through its schedulers. Use bStats 3.2.1, which also
  runs on Folia, in place of the copied Metrics class.

Code and tests:
- Remove unused targeting code.
- Save toggle choices in one toggles.yml. Move the old players folder.
- Add JUnit tests, a CI job that runs the bot tests on 4 servers and a
  release workflow for version tags.
- Override uuid in the e2e test dependencies to fix a moderate alert.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@zeshan321
zeshan321 merged commit 4985cd6 into master Oct 3, 2026
4 checks passed
@zeshan321
zeshan321 deleted the feat/improvements branch October 3, 2026 03:19
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.

1 participant