code reformat
This commit is contained in:
@@ -7,7 +7,7 @@ import java.util.function.Consumer;
|
||||
|
||||
public class LocationUtil {
|
||||
public static void iterateBlocks(Location loc1, Location loc2, Consumer<Location> action) {
|
||||
if (loc1.getWorld() != loc2.getWorld()) {
|
||||
if(loc1.getWorld() != loc2.getWorld()) {
|
||||
throw new IllegalArgumentException("Locations must be in the same world");
|
||||
}
|
||||
|
||||
@@ -19,9 +19,9 @@ public class LocationUtil {
|
||||
int minZ = Math.min(loc1.getBlockZ(), loc2.getBlockZ());
|
||||
int maxZ = Math.max(loc1.getBlockZ(), loc2.getBlockZ());
|
||||
|
||||
for (int x = minX; x <= maxX; x++) {
|
||||
for (int y = minY; y <= maxY; y++) {
|
||||
for (int z = minZ; z <= maxZ; z++) {
|
||||
for(int x = minX; x <= maxX; x++) {
|
||||
for(int y = minY; y <= maxY; y++) {
|
||||
for(int z = minZ; z <= maxZ; z++) {
|
||||
action.accept(new Location(world, x, y, z));
|
||||
}
|
||||
}
|
||||
|
@@ -8,6 +8,7 @@ public class MinMaxUtil {
|
||||
public static <I, O extends Comparable<O>> O getMinProperty(List<I> list, Function<I, O> supplier) {
|
||||
return supplier.apply(list.stream().min(Comparator.comparing(supplier)).orElseThrow());
|
||||
}
|
||||
|
||||
public static <I, O extends Comparable<O>> O getMaxProperty(List<I> list, Function<I, O> supplier) {
|
||||
return supplier.apply(list.stream().max(Comparator.comparing(supplier)).orElseThrow());
|
||||
}
|
||||
|
Reference in New Issue
Block a user