tastybento 2019-01-25 11:09:45 -08:00
parent 8ca438640f
commit 1c93fba11a
2 changed files with 8 additions and 5 deletions

View File

@ -6,7 +6,7 @@
<groupId>world.bentobox</groupId> <groupId>world.bentobox</groupId>
<artifactId>acidisland</artifactId> <artifactId>acidisland</artifactId>
<version>1.1-SNAPSHOT</version> <version>1.2-SNAPSHOT</version>
<name>AcidIsland</name> <name>AcidIsland</name>
<description>AcidIsland is an add-on for BentoBox, an expandable Minecraft Bukkit plugin for island-type games like SkyBlock or AcidIsland.</description> <description>AcidIsland is an add-on for BentoBox, an expandable Minecraft Bukkit plugin for island-type games like SkyBlock or AcidIsland.</description>

View File

@ -7,8 +7,10 @@ import java.util.WeakHashMap;
import java.util.stream.Stream; import java.util.stream.Stream;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.Material;
import org.bukkit.Sound; import org.bukkit.Sound;
import org.bukkit.entity.Animals; import org.bukkit.entity.Animals;
import org.bukkit.entity.Drowned;
import org.bukkit.entity.Entity; import org.bukkit.entity.Entity;
import org.bukkit.entity.EntityType; import org.bukkit.entity.EntityType;
import org.bukkit.entity.Guardian; import org.bukkit.entity.Guardian;
@ -16,6 +18,7 @@ import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.MagmaCube; import org.bukkit.entity.MagmaCube;
import org.bukkit.entity.Monster; import org.bukkit.entity.Monster;
import org.bukkit.entity.Squid; import org.bukkit.entity.Squid;
import org.bukkit.entity.Turtle;
import world.bentobox.acidisland.AcidIsland; 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() { private void burnEntities() {
// This part will kill monsters if they fall into the water because it is acid // This part will kill monsters if they fall into the water because it is acid
entityBurnTask = Bukkit.getScheduler().scheduleSyncRepeatingTask(addon.getPlugin(), () -> getEntityStream() entityBurnTask = Bukkit.getScheduler().scheduleSyncRepeatingTask(addon.getPlugin(), () -> getEntityStream()
.filter(e -> !(e instanceof Guardian || e instanceof Squid)) // These entities are immune to acid
// TODO: remove backwards compatibility hack .filter(e -> !(e instanceof Guardian || e instanceof Squid || e instanceof Turtle || e instanceof Drowned))
.filter(w -> w.getLocation().getBlock().getType().name().contains("WATER")) .filter(w -> w.getLocation().getBlock().getType().equals(Material.WATER))
.forEach(e -> { .forEach(e -> {
if ((e instanceof Monster || e instanceof MagmaCube) && addon.getSettings().getAcidDamageMonster() > 0D) { if ((e instanceof Monster || e instanceof MagmaCube) && addon.getSettings().getAcidDamageMonster() > 0D) {
((LivingEntity) e).damage(addon.getSettings().getAcidDamageMonster()); ((LivingEntity) e).damage(addon.getSettings().getAcidDamageMonster());