diff --git a/changelog.md b/changelog.md index 1ba1a96..ea50b1b 100644 --- a/changelog.md +++ b/changelog.md @@ -13,6 +13,7 @@ These changes will (most likely) be included in the next version. ## [Unreleased] - Like the other user commands, the permission for `/ma ready` now defaults to true. - Unbreakable weapons and armor now use the unbreakable item flag instead of item durability and on-hit repairs. This means that MobArena's unbreakable items are now compatible with plugins that depend on special durability values, such as QualityArmory. +- Spectators can no longer take damage when the arena isn't running. ## [0.103] - 2018-08-28 - It is now possible to add a fixed delay (in seconds) between waves with the new per-arena setting `next-wave-delay`. diff --git a/src/main/java/com/garbagemule/MobArena/ArenaListener.java b/src/main/java/com/garbagemule/MobArena/ArenaListener.java index 97cf979..b9a70ea 100644 --- a/src/main/java/com/garbagemule/MobArena/ArenaListener.java +++ b/src/main/java/com/garbagemule/MobArena/ArenaListener.java @@ -690,9 +690,6 @@ public class ArenaListener public void onEntityDamage(EntityDamageEvent event) { Entity damagee = event.getEntity(); - if (!arena.isRunning() && !arena.getRegion().contains(damagee.getLocation())) { - return; - } EntityDamageByEntityEvent edbe = (event instanceof EntityDamageByEntityEvent) ? (EntityDamageByEntityEvent) event : null; Entity damager = null; @@ -736,7 +733,9 @@ public class ArenaListener } // Snowmen melting else if (damagee instanceof Snowman && event.getCause() == DamageCause.MELTING) { - event.setCancelled(true); + if (arena.isRunning() && arena.getRegion().contains(damagee.getLocation())) { + event.setCancelled(true); + } } // Boss monster else if (boss != null) {