From d5676b7b7444bcb8ec9935ae95d14daf266a3eae Mon Sep 17 00:00:00 2001 From: Andreas Troelsen Date: Thu, 25 Jul 2019 23:15:05 +0200 Subject: [PATCH] Fix check for arena monsters in monster damage logic. This commit changes how the final "catch all" works for incoming monster damage. Instead of checking if the damager entity is a LivingEntity, we check if it is a monster of the arena and then proceed as normal. Note that this change may make it possible for monsters in the arena to take damage from non-arena entities. The so-called "catch all" doesn't really catch everything, but it does catch the infighting that it was designed to catch. One "not thought of" damage source is that of player-made golems, so coincidentally, this commit fixes #550. --- changelog.md | 1 + src/main/java/com/garbagemule/MobArena/ArenaListener.java | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/changelog.md b/changelog.md index 364a0f6..15b13f6 100644 --- a/changelog.md +++ b/changelog.md @@ -18,6 +18,7 @@ These changes will (most likely) be included in the next version. - MobArena no longer crashes when players try to join with items that lower their max health below the default of 20. Players with lower max health will notice missing health in the lobby, but it will quickly regenerate to full. - Food levels no longer deplete for players in the lobby and spectator area. - Wither skeletons now correctly spawn with stone swords. +- Mobs now correctly take damage from player-made iron golems. - Support for denoting potion effects by magic number IDs has been dropped. This means that if your config-file has any such magic numbers in it, MobArena will no longer successfully parse them and will throw an error on startup. ## [0.103.2] - 2019-04-23 diff --git a/src/main/java/com/garbagemule/MobArena/ArenaListener.java b/src/main/java/com/garbagemule/MobArena/ArenaListener.java index 089d884..9400d87 100644 --- a/src/main/java/com/garbagemule/MobArena/ArenaListener.java +++ b/src/main/java/com/garbagemule/MobArena/ArenaListener.java @@ -763,8 +763,7 @@ public class ArenaListener ArenaPlayerStatistics aps = arena.getArenaPlayer(p).getStats(); aps.add("dmgDone", event.getDamage()); } - //TODO add in check for player made golems doing damage - else if (damager instanceof LivingEntity) { + else if (monsters.getMonsters().contains(damager)) { if (!monsterInfight) event.setCancelled(true); }