This commit is contained in:
batchprogrammer314
2021-08-21 13:36:10 -05:00
parent d86a42eab6
commit 84f3918c25
20 changed files with 317 additions and 186 deletions

View File

@@ -67,4 +67,22 @@ public class PlayerUtils {
return loc.clone().add(0, amount, 0);
}
}
public static Location findBottom(Location loc) {
loc.setY(loc.getBlockY());
for (int i = 0; i < 255; i++) {
Location check = loc.clone().add(0, -i, 0);
if (check.getY() <= 0) {
break;
}
if (check.getBlock().getType().isSolid()) {
return check.add(0, 1, 0);
}
}
return loc;
}
}