From 1c93fba11a33b71e82da84c59e30f0dc7078586c Mon Sep 17 00:00:00 2001 From: tastybento Date: Fri, 25 Jan 2019 11:09:45 -0800 Subject: [PATCH] Turtles and downed are immune to acid https://github.com/BentoBoxWorld/AcidIsland/issues/29 https://github.com/BentoBoxWorld/AcidIsland/issues/28 --- pom.xml | 2 +- .../world/bentobox/acidisland/world/AcidTask.java | 11 +++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/pom.xml b/pom.xml index f29c5aa..1087813 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ world.bentobox acidisland - 1.1-SNAPSHOT + 1.2-SNAPSHOT AcidIsland AcidIsland is an add-on for BentoBox, an expandable Minecraft Bukkit plugin for island-type games like SkyBlock or AcidIsland. diff --git a/src/main/java/world/bentobox/acidisland/world/AcidTask.java b/src/main/java/world/bentobox/acidisland/world/AcidTask.java index 96faf89..4a3ee35 100644 --- a/src/main/java/world/bentobox/acidisland/world/AcidTask.java +++ b/src/main/java/world/bentobox/acidisland/world/AcidTask.java @@ -7,8 +7,10 @@ import java.util.WeakHashMap; import java.util.stream.Stream; import org.bukkit.Bukkit; +import org.bukkit.Material; import org.bukkit.Sound; import org.bukkit.entity.Animals; +import org.bukkit.entity.Drowned; import org.bukkit.entity.Entity; import org.bukkit.entity.EntityType; import org.bukkit.entity.Guardian; @@ -16,6 +18,7 @@ import org.bukkit.entity.LivingEntity; import org.bukkit.entity.MagmaCube; import org.bukkit.entity.Monster; import org.bukkit.entity.Squid; +import org.bukkit.entity.Turtle; import world.bentobox.acidisland.AcidIsland; @@ -36,14 +39,14 @@ public class AcidTask { } /** - * Start the entity buring task + * Start the entity burning task */ private void burnEntities() { // This part will kill monsters if they fall into the water because it is acid entityBurnTask = Bukkit.getScheduler().scheduleSyncRepeatingTask(addon.getPlugin(), () -> getEntityStream() - .filter(e -> !(e instanceof Guardian || e instanceof Squid)) - // TODO: remove backwards compatibility hack - .filter(w -> w.getLocation().getBlock().getType().name().contains("WATER")) + // These entities are immune to acid + .filter(e -> !(e instanceof Guardian || e instanceof Squid || e instanceof Turtle || e instanceof Drowned)) + .filter(w -> w.getLocation().getBlock().getType().equals(Material.WATER)) .forEach(e -> { if ((e instanceof Monster || e instanceof MagmaCube) && addon.getSettings().getAcidDamageMonster() > 0D) { ((LivingEntity) e).damage(addon.getSettings().getAcidDamageMonster());