From 68ede87bb927cde10227f2ec27857211d8a14fe7 Mon Sep 17 00:00:00 2001 From: tastybento Date: Tue, 22 Oct 2024 22:33:17 -0700 Subject: [PATCH] Do not use isAir() because it cannot be mocked. --- .../world/bentobox/bentobox/database/objects/Island.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/world/bentobox/bentobox/database/objects/Island.java b/src/main/java/world/bentobox/bentobox/database/objects/Island.java index c9b585a9b..e55c6a0ea 100644 --- a/src/main/java/world/bentobox/bentobox/database/objects/Island.java +++ b/src/main/java/world/bentobox/bentobox/database/objects/Island.java @@ -19,6 +19,7 @@ import java.util.stream.Collectors; import org.bukkit.Bukkit; import org.bukkit.GameMode; import org.bukkit.Location; +import org.bukkit.Material; import org.bukkit.World; import org.bukkit.World.Environment; import org.bukkit.entity.Player; @@ -1512,7 +1513,7 @@ public class Island implements DataObject, MetaDataAble { */ public boolean hasNetherIsland() { World nether = BentoBox.getInstance().getIWM().getNetherWorld(getWorld()); - return nether != null && !getCenter().toVector().toLocation(nether).getBlock().getType().isAir(); + return nether != null && (getCenter().toVector().toLocation(nether).getBlock().getType() != Material.AIR); } /** @@ -1536,7 +1537,7 @@ public class Island implements DataObject, MetaDataAble { */ public boolean hasEndIsland() { World end = BentoBox.getInstance().getIWM().getEndWorld(getWorld()); - return end != null && !getCenter().toVector().toLocation(end).getBlock().getType().isAir(); + return end != null && (getCenter().toVector().toLocation(end).getBlock().getType() != Material.AIR); } /**