From bc1b39078d81d32d2abcae9d095015dc32e50f8e Mon Sep 17 00:00:00 2001 From: FloG99 <63739845+FloG99@users.noreply.github.com> Date: Fri, 22 Mar 2024 03:32:42 +0100 Subject: [PATCH] Fixed faulty /home positioning (#3) --- .../java/com/johnymuffin/beta/fundamentals/util/Utils.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/FundamentalsCore/src/main/java/com/johnymuffin/beta/fundamentals/util/Utils.java b/FundamentalsCore/src/main/java/com/johnymuffin/beta/fundamentals/util/Utils.java index c2c0b7e..06d2b02 100644 --- a/FundamentalsCore/src/main/java/com/johnymuffin/beta/fundamentals/util/Utils.java +++ b/FundamentalsCore/src/main/java/com/johnymuffin/beta/fundamentals/util/Utils.java @@ -126,6 +126,7 @@ public static String getPlayerName(UUID uuid) { AIR_MATERIALS.add(Material.WOOD_PLATE.getId()); AIR_MATERIALS.add(Material.IRON_DOOR_BLOCK.getId()); AIR_MATERIALS.add(Material.WOODEN_DOOR.getId()); + AIR_MATERIALS.add(Material.SNOW.getId()); } public static Location getSafeDestination(final Location loc) throws Exception { @@ -133,9 +134,9 @@ public static Location getSafeDestination(final Location loc) throws Exception { throw new Exception("Invalid Location Object"); } final World world = loc.getWorld(); - int x = (int) Math.round(loc.getX()); - int y = (int) Math.round(loc.getY()); - int z = (int) Math.round(loc.getZ()); + int x = (int) Math.floor(loc.getX()); + int y = (int) Math.ceil(loc.getY()); + int z = (int) Math.floor(loc.getZ()); while (isBlockAboveAir(world, x, y, z)) { y -= 1;