diff --git a/src/main/java/world/bentobox/bentobox/managers/island/NewIsland.java b/src/main/java/world/bentobox/bentobox/managers/island/NewIsland.java index 37903244b..a85856947 100644 --- a/src/main/java/world/bentobox/bentobox/managers/island/NewIsland.java +++ b/src/main/java/world/bentobox/bentobox/managers/island/NewIsland.java @@ -11,6 +11,7 @@ import org.bukkit.World; import org.bukkit.World.Environment; import org.bukkit.util.Vector; +import org.eclipse.jdt.annotation.Nullable; import world.bentobox.bentobox.BStats; import world.bentobox.bentobox.BentoBox; import world.bentobox.bentobox.api.events.IslandBaseEvent; @@ -71,7 +72,6 @@ public class NewIsland { /** * Build a new island for a player * @author tastybento - * */ public static class Builder { private Island oldIsland2; @@ -232,11 +232,14 @@ public class NewIsland { * Get the location of next free island spot * @return Location of island spot or null if one cannot be found */ + @Nullable private Location getNextIsland() { Location last = plugin.getIslands().getLast(world); if (last == null) { - last = new Location(world, plugin.getIWM().getIslandXOffset(world) + plugin.getIWM().getIslandStartX(world), - plugin.getIWM().getIslandHeight(world), plugin.getIWM().getIslandZOffset(world) + plugin.getIWM().getIslandStartZ(world)); + last = new Location(world, + (double) plugin.getIWM().getIslandXOffset(world) + plugin.getIWM().getIslandStartX(world), + plugin.getIWM().getIslandHeight(world), + (double) plugin.getIWM().getIslandZOffset(world) + plugin.getIWM().getIslandStartZ(world)); } // Find a free spot Map result = new EnumMap<>(Result.class); diff --git a/src/main/java/world/bentobox/bentobox/util/teleport/SafeSpotTeleport.java b/src/main/java/world/bentobox/bentobox/util/teleport/SafeSpotTeleport.java index 1bee1eabe..4bcf0175a 100644 --- a/src/main/java/world/bentobox/bentobox/util/teleport/SafeSpotTeleport.java +++ b/src/main/java/world/bentobox/bentobox/util/teleport/SafeSpotTeleport.java @@ -306,7 +306,7 @@ public class SafeSpotTeleport { } private boolean safe(ChunkSnapshot chunk, int x, int y, int z, World world) { - Vector newSpot = new Vector((chunk.getX() << 4) + x + 0.5D, y + 1, (chunk.getZ() << 4) + z + 0.5D); + Vector newSpot = new Vector((chunk.getX() << 4) + x + 0.5D, y + 1.0D, (chunk.getZ() << 4) + z + 0.5D); if (portal) { if (bestSpot == null) { // Stash the best spot