From 15a79bdd7e26124d1f40b34d4f0043e20612a816 Mon Sep 17 00:00:00 2001 From: Andreas Troelsen Date: Fri, 28 Apr 2023 20:46:38 +0200 Subject: [PATCH] Remove discrepancy in auto-ready behavior. It's not clear why this variation in the auto-ready logic exists, and the commit history doesn't seem to have any clues either. Perhaps the actual readying up logic was incompatible with auto-ready at some point, but at this point in time it doesn't seem like this is necessary at all, and it appears to be causing a bug with the MobArenaStats extension. By simply calling the player ready procedure regardless of the status of the auto start timer, MobArena fires the arena player ready event that MobArenaStats depends on for some of its pre-session bookkeeping. It could be argued that MobArenaStats should be more robust, but we would much rather fix the root problem than slack on the otherwise fairly sound strictness of the MobArenaStats data model. Fixes #746 --- changelog.md | 1 + src/main/java/com/garbagemule/MobArena/ArenaImpl.java | 6 +----- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/changelog.md b/changelog.md index 10d94de..9fea934 100644 --- a/changelog.md +++ b/changelog.md @@ -14,6 +14,7 @@ These changes will (most likely) be included in the next version. ### Fixed - Explosion damage caused by Exploding Sheep now correctly counts as monster damage. This means that the explosions only affect other mobs if the per-arena setting `monster-infight` is set to `true`. - Explosion damage caused by the boss ability `obsidian-bomb` now correctly counts as monster damage. This means that the explosions only affect other mobs if the per-arena setting `monster-infight` is set to `true`. +- An old discrepancy with auto start timers in the auto-ready logic has been removed. This fixes an issue in MobArenaStats where the extension would throw errors in arenas with `auto-ready: true` and a non-zero auto start timer. Note that the combination of `auto-ready: true` and a `default-class` now _requires_ the use of a `start-delay-timer` to prevent the arena from starting immediately when the first player joins. ## [0.107] - 2022-07-30 ### Added diff --git a/src/main/java/com/garbagemule/MobArena/ArenaImpl.java b/src/main/java/com/garbagemule/MobArena/ArenaImpl.java index c32b2e7..04ac390 100644 --- a/src/main/java/com/garbagemule/MobArena/ArenaImpl.java +++ b/src/main/java/com/garbagemule/MobArena/ArenaImpl.java @@ -1310,11 +1310,7 @@ public class ArenaImpl implements Arena private void autoReady(Player p) { if (settings.getBoolean("auto-ready", false)) { - if (autoStartTimer.getRemaining() <= 0) { - playerReady(p); - } else { - readyPlayers.add(p); - } + playerReady(p); } }