From a59a4f911d77b0aaf700cbb3aa040f516dbfef31 Mon Sep 17 00:00:00 2001 From: Andreas Troelsen Date: Fri, 16 Aug 2019 00:46:01 +0200 Subject: [PATCH] Don't check for recurrent waves on join. This commit removes a condition in ArenaImpl#canJoin(Player) that checks to see if the arena's WaveManager has any recurrent waves. Removing this condition is safe, because the WaveManager already makes sure to have a "catch all" default wave at hand for when no wave definitions match a given wave number. As such, the condition in ArenaImpl is completely unnecessary, and was in fact the root cause of a bug. Fixes #566 --- changelog.md | 1 + src/main/java/com/garbagemule/MobArena/ArenaImpl.java | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/changelog.md b/changelog.md index db92780..11b8002 100644 --- a/changelog.md +++ b/changelog.md @@ -11,6 +11,7 @@ These changes will (most likely) be included in the next version. ## [Unreleased] +- It is no longer necessary to have recurrent waves for an arena to work. MobArena automatically creates a "catch all" recurrent wave in case the arena session reaches a wave number that isn't covered by any other wave definitions. ## [0.104] - 2019-08-08 - Extended and upgraded potions are now supported in the item syntax by prepending `long_` or `strong_` to the data portion of a potion item (e.g. `potion:strong_instant_heal:1` will yield a Potion of Healing II). Check the wiki for details. diff --git a/src/main/java/com/garbagemule/MobArena/ArenaImpl.java b/src/main/java/com/garbagemule/MobArena/ArenaImpl.java index a62ac27..c8afe26 100644 --- a/src/main/java/com/garbagemule/MobArena/ArenaImpl.java +++ b/src/main/java/com/garbagemule/MobArena/ArenaImpl.java @@ -1507,7 +1507,7 @@ public class ArenaImpl implements Arena public boolean canJoin(Player p) { if (!enabled) messenger.tell(p, Msg.JOIN_ARENA_NOT_ENABLED); - else if (!region.isSetup() || waveManager.getRecurrentWaves().isEmpty()) + else if (!region.isSetup()) messenger.tell(p, Msg.JOIN_ARENA_NOT_SETUP); else if (edit) messenger.tell(p, Msg.JOIN_ARENA_EDIT_MODE);