GH-422 Keep combat tag active below void height to prevent evasion - #422
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 35e19d0eed
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if (this.config.combat.keepCombatActiveInVoid && player.getLocation().getY() < this.config.combat.voidCombatHeight) { | ||
| FightTagEvent tagEvent = this.fightManager.tag(playerUniqueId, this.config.settings.combatTimerDuration, CauseOfTag.VOID, fightTag.getTagger()); |
There was a problem hiding this comment.
Check expiration before refreshing the void tag
When the tag timestamp expires between the task's one-second runs and the player crosses below the configured height during that interval, the expired tag is still present in getFights(), so this call replaces it with a fresh full-duration tag before the later isExpired() check. Since FightManager.isInCombat() already returns false once the timestamp passes, this re-enters a player into combat rather than merely keeping an active tag alive; reject expired tags before applying the void refresh.
Useful? React with 👍 / 👎.
| if (this.config.combat.keepCombatActiveInVoid && player.getLocation().getY() < this.config.combat.voidCombatHeight) { | ||
| FightTagEvent tagEvent = this.fightManager.tag(playerUniqueId, this.config.settings.combatTimerDuration, CauseOfTag.VOID, fightTag.getTagger()); |
There was a problem hiding this comment.
Honor ignored worlds before refreshing void tags
When an already-tagged player teleports into a world listed in settings.ignoredWorlds and remains below voidCombatHeight, this path keeps resetting the tag indefinitely because it never applies the ignored-world predicate used by the damage taggers. Such players remain subject to combat restrictions and logout punishment even though the configuration says players in those worlds are unaffected, so skip the refresh when the player's current world is ignored.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bc11f46275
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if (this.config.combat.keepCombatActiveInVoid | ||
| && player.getLocation().getY() < this.config.combat.voidCombatHeight | ||
| && !this.config.settings.ignoredWorlds.contains(player.getWorld().getName())) { | ||
| FightTagEvent tagEvent = this.fightManager.tag(playerUniqueId, this.config.settings.combatTimerDuration, CauseOfTag.VOID, fightTag.getTagger()); |
There was a problem hiding this comment.
Avoid replaying tag-start side effects on every void refresh
When this option is enabled and a tagged player remains below the configured height, FightTask invokes tag once per second, which synchronously publishes a normal FightTagEvent. Existing listeners do not distinguish CauseOfTag.VOID: for example, KnockbackRegionController.onTag knocks the player again when they are inside a configured region, while BorderTriggerController recomputes the border and external API listeners may treat every refresh as a new tag. Refresh the deadline without replaying tag-start behavior, or make the affected listeners explicitly ignore refresh events.
Useful? React with 👍 / 👎.
No description provided.