From 15dedc90a434fb21ce392ce0176c475776890a1c Mon Sep 17 00:00:00 2001 From: Tyler Murphy Date: Thu, 26 May 2022 09:57:21 -0400 Subject: [PATCH] 1.5.0 Release Canidate 4.2b --- .../hideAndSeek/game/listener/DamageHandler.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/java/net/tylermurphy/hideAndSeek/game/listener/DamageHandler.java b/src/main/java/net/tylermurphy/hideAndSeek/game/listener/DamageHandler.java index 55741b6..7f0e4d5 100644 --- a/src/main/java/net/tylermurphy/hideAndSeek/game/listener/DamageHandler.java +++ b/src/main/java/net/tylermurphy/hideAndSeek/game/listener/DamageHandler.java @@ -61,12 +61,13 @@ public class DamageHandler implements Listener { event.setCancelled(true); return; } - // If there is no attacker, it must of been by natural causes. If pvp is disabled, and config doesn't allow natural causes, cancel event. - } else if (!pvpEnabled && !allowNaturalCauses && board.contains(player)) { + // If there is no attacker, it most of been by natural causes. If pvp is disabled, and config doesn't allow natural causes, cancel event. + // Also, if there was no attacker, if the damaged is not a player, ignore them. + } else if (!board.contains(player) || !pvpEnabled && !allowNaturalCauses && board.contains(player)) { event.setCancelled(true); return; } - // Spectators cannot take damage + // Spectators and cannot take damage if (board.isSpectator(player)) { event.setCancelled(true); if (Main.getInstance().supports(18) && player.getLocation().getBlockY() < -64) {