Only burn entities in loaded chunks

https://github.com/BentoBoxWorld/AcidIsland/issues/84
This commit is contained in:
tastybento 2020-04-09 11:01:46 -07:00
parent 5b3344498d
commit f344208460

View File

@ -48,6 +48,8 @@ public class AcidTask {
entityBurnTask = Bukkit.getScheduler().scheduleSyncRepeatingTask(addon.getPlugin(), () -> getEntityStream()
// These entities are immune to acid
.filter(e -> !IMMUNE.contains(e.getType()))
// Only burn if the chunk is loaded
.filter(e -> e.getLocation().getChunk().isLoaded())
.filter(w -> w.getLocation().getBlock().getType().equals(Material.WATER))
.forEach(e -> {
if ((e instanceof Monster || e instanceof MagmaCube) && addon.getSettings().getAcidDamageMonster() > 0D) {