mirror of
https://github.com/TotalFreedomMC/TF-PlotSquared.git
synced 2024-12-23 00:15:06 +00:00
Fix typo in MainUtil and switch out Consumer<Integer> to IntConsumer
This commit is contained in:
parent
254a0541cc
commit
f717589074
4 changed files with 7 additions and 5 deletions
|
@ -45,6 +45,7 @@ import java.util.List;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import java.util.function.Consumer;
|
import java.util.function.Consumer;
|
||||||
|
import java.util.function.IntConsumer;
|
||||||
|
|
||||||
|
|
||||||
@SuppressWarnings({"unused", "WeakerAccess"})
|
@SuppressWarnings({"unused", "WeakerAccess"})
|
||||||
|
@ -301,7 +302,7 @@ public class BukkitUtil extends WorldUtil {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override public void getHighestBlock(@NonNull final String world, final int x, final int z,
|
@Override public void getHighestBlock(@NonNull final String world, final int x, final int z,
|
||||||
final Consumer<Integer> result) {
|
final IntConsumer result) {
|
||||||
ensureLoaded(world, x, z, chunk -> {
|
ensureLoaded(world, x, z, chunk -> {
|
||||||
final World bukkitWorld = getWorld(world);
|
final World bukkitWorld = getWorld(world);
|
||||||
// Skip top and bottom block
|
// Skip top and bottom block
|
||||||
|
|
|
@ -127,7 +127,7 @@ public class PlotCluster {
|
||||||
public void getHome(Consumer<Location> result) {
|
public void getHome(Consumer<Location> result) {
|
||||||
BlockLoc home = this.settings.getPosition();
|
BlockLoc home = this.settings.getPosition();
|
||||||
Consumer<Location> locationConsumer = toReturn -> {
|
Consumer<Location> locationConsumer = toReturn -> {
|
||||||
MainUtil.getHeighestBlock(this.area.getWorldName(), toReturn.getX(), toReturn.getZ(), max -> {
|
MainUtil.getHighestBlock(this.area.getWorldName(), toReturn.getX(), toReturn.getZ(), max -> {
|
||||||
if (max > toReturn.getY()) {
|
if (max > toReturn.getY()) {
|
||||||
toReturn.setY(1 + max);
|
toReturn.setY(1 + max);
|
||||||
}
|
}
|
||||||
|
|
|
@ -55,8 +55,8 @@ import java.util.Objects;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import java.util.function.Consumer;
|
|
||||||
import java.util.function.Function;
|
import java.util.function.Function;
|
||||||
|
import java.util.function.IntConsumer;
|
||||||
import java.util.function.IntFunction;
|
import java.util.function.IntFunction;
|
||||||
import java.util.function.Supplier;
|
import java.util.function.Supplier;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
@ -591,7 +591,7 @@ public class MainUtil {
|
||||||
/**
|
/**
|
||||||
* Get the highest block at a location.
|
* Get the highest block at a location.
|
||||||
*/
|
*/
|
||||||
public static void getHeighestBlock(String world, int x, int z, Consumer<Integer> result) {
|
public static void getHighestBlock(String world, int x, int z, IntConsumer result) {
|
||||||
WorldUtil.IMP.getHighestBlock(world, x, z, highest -> {
|
WorldUtil.IMP.getHighestBlock(world, x, z, highest -> {
|
||||||
if (highest == 0) {
|
if (highest == 0) {
|
||||||
result.accept(63);
|
result.accept(63);
|
||||||
|
|
|
@ -26,6 +26,7 @@ import java.util.Map;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import java.util.function.Consumer;
|
import java.util.function.Consumer;
|
||||||
|
import java.util.function.IntConsumer;
|
||||||
import java.util.zip.GZIPInputStream;
|
import java.util.zip.GZIPInputStream;
|
||||||
import java.util.zip.GZIPOutputStream;
|
import java.util.zip.GZIPOutputStream;
|
||||||
import java.util.zip.ZipEntry;
|
import java.util.zip.ZipEntry;
|
||||||
|
@ -74,7 +75,7 @@ public abstract class WorldUtil {
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public abstract BlockState getBlockSynchronous(Location location);
|
public abstract BlockState getBlockSynchronous(Location location);
|
||||||
|
|
||||||
public abstract void getHighestBlock(String world, int x, int z, final Consumer<Integer> result);
|
public abstract void getHighestBlock(String world, int x, int z, final IntConsumer result);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @deprecated May result in synchronous chunk loading
|
* @deprecated May result in synchronous chunk loading
|
||||||
|
|
Loading…
Reference in a new issue