Repository navigation
feat: log nonlethal knockouts in CoreProtect - #125
Conversation
CoreProtect now logs every hit between players, but it never sees a nonlethal knockout: RPCharacters cancels the knockout blow, and CoreProtect skips cancelled hits. Report each knockout to CoreProtect's new logPvpKnockout API so staff see it next to the hits that led to it. CoreProtect is reached by reflection, so RPCharacters gains no load order against it and keeps working without it or with an older version, which gets one warning. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Summary
Merge Risk: ⚪ Minimal · up to
|
Summary
CoreProtect now logs every hit, knockout and kill between players (TF-Minecraft/CoreProtect#26), so staff can see who attacked first. It can't see a nonlethal knockout on its own:
PvpKnockoutManagercancels the knockout blow, and CoreProtect skips cancelled hits.PvpKnockoutManager.onLethalDamagenow reports each knockout to CoreProtect's newlogPvpKnockout(Player attacker, Player victim)API throughCoreProtectKnockouts.depend/softdependand no load-order risk.Testing
CoreProtectKnockoutsTestcovers a successful call, a missing, disabled or not-ready CoreProtect, null players, and an older API (warns once).PvpKnockoutManagerTestnow checks that a knockout is reported with the right attacker and victim.DatabaseLoadTest,DatabasePersistenceTest,GraveManagerTest,BodyStoreTest) fail on this host because it runs as root, and they fail on unmodifiedmainthere too. CI runs them as a normal user.🤖 Generated with Claude Code