Skip to content

Commit

Permalink
Fixed faulty /home positioning (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
FloG99 authored Mar 22, 2024
1 parent a3da8c0 commit bc1b390
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -126,16 +126,17 @@ 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 {
if (loc == null || loc.getWorld() == null) {
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;
Expand Down

0 comments on commit bc1b390

Please sign in to comment.