mirror of
https://github.com/BentoBoxWorld/AcidIsland.git
synced 2024-12-23 09:37:43 +01:00
Only burn entities in loaded chunks
https://github.com/BentoBoxWorld/AcidIsland/issues/84
This commit is contained in:
parent
5b3344498d
commit
f344208460
@ -48,6 +48,8 @@ public class AcidTask {
|
|||||||
entityBurnTask = Bukkit.getScheduler().scheduleSyncRepeatingTask(addon.getPlugin(), () -> getEntityStream()
|
entityBurnTask = Bukkit.getScheduler().scheduleSyncRepeatingTask(addon.getPlugin(), () -> getEntityStream()
|
||||||
// These entities are immune to acid
|
// These entities are immune to acid
|
||||||
.filter(e -> !IMMUNE.contains(e.getType()))
|
.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))
|
.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) {
|
||||||
|
Loading…
Reference in New Issue
Block a user