Ensure safety resolver returns y within height limits, close #401

This commit is contained in:
William278 committed 2023-05-22 12:37:07 +01:00
1 parent cb9d4808f2
commit fa40494221
2 files changed
+10 -5

No files matched your search

@@ -65,7 +65,7 @@ public interface FabricSafetyResolver extends SafetyResolver {
* @param location The location to search around
* @return An optional safe location, within 4 blocks of the given location
*/
private Optional<Location> findSafeLocationNear(Location location, ServerWorld world) {
private Optional<Location> findSafeLocationNear(@NotNull Location location, @NotNull ServerWorld world) {
final BlockPos.Mutable blockPos = new BlockPos.Mutable(location.getX(), location.getY(), location.getZ());
for (int x = -SEARCH_RADIUS; x <= SEARCH_RADIUS; x++) {
for (int z = -SEARCH_RADIUS; z <= SEARCH_RADIUS; z++) {