Repository navigation
3.8.0: Folia support, bug fixes, tests and CI - #77
Merged
Merged
Conversation
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>
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 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
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.Upper Limit Health. The config comment told owners to do this.Nameline without=.Action.Events.==. This worked only because Bukkit returns the same object each time. The code now usesequals.Performance
CheckTicksvalue.Display Timetimer.getNamemethod is cached for each entity class.Server owners
config.ymlare 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 isAbsorption Icon, which is added as"", because the plugin reads it with its own default.No Permissionin the config) and a newActionHealth.Togglepermission. All players have that permission by default.plugin.ymlnow lists all three permissions. The defaults are the same as before.utils/Scheduler.javauses 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.Remember Togglenow saves to onetoggles.yml, read once at startup. Before, the plugin read one file for each player on every join. The oldplayersfolder is moved intotoggles.ymlone time and renamed toplayers-old.ShowArmorStandfrom the default config. The plugin never read it. Armor stands stay hidden, as before.Code and tests
FileHandler.compat/e2e/ci.shruns the bot tests on Spigot 1.8.8, Spigot 1.21.11, Paper 26.3 and Folia 1.21.11. A newe2ejob in the build workflow runs it..github/workflows/release.ymlcreates the GitHub release from an annotated version tag. It checks that the tag matchesbuild.gradle.uuidto 11.1.1 in the test dependencies. This fixes Dependabot alert 1.config-update,last-damageandpermission. Thedisplay-timecheck now counts from the moment the bot looks away.Not in this PR
/ahalias. 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
last-damagecheck 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.Test results
All on the jar from commit b2927f5 (SHA-256
2f681fbc...505dc1):🤖 Generated with Claude Code