diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitUtil.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitUtil.java index ca6bf6867..87fc5c92b 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitUtil.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitUtil.java @@ -45,6 +45,7 @@ import java.util.List; import java.util.Set; import java.util.UUID; import java.util.function.Consumer; +import java.util.function.IntConsumer; @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, - final Consumer result) { + final IntConsumer result) { ensureLoaded(world, x, z, chunk -> { final World bukkitWorld = getWorld(world); // Skip top and bottom block diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotCluster.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotCluster.java index f2245d940..ba877017c 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotCluster.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotCluster.java @@ -127,7 +127,7 @@ public class PlotCluster { public void getHome(Consumer result) { BlockLoc home = this.settings.getPosition(); Consumer 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()) { toReturn.setY(1 + max); } diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/MainUtil.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/MainUtil.java index 2306b54b2..26281d7a8 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/MainUtil.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/MainUtil.java @@ -55,8 +55,8 @@ import java.util.Objects; import java.util.Optional; import java.util.Set; import java.util.UUID; -import java.util.function.Consumer; import java.util.function.Function; +import java.util.function.IntConsumer; import java.util.function.IntFunction; import java.util.function.Supplier; import java.util.stream.Collectors; @@ -591,7 +591,7 @@ public class MainUtil { /** * Get the highest block at a location. */ - public static void getHeighestBlock(String world, int x, int z, Consumer result) { + public static void getHighestBlock(String world, int x, int z, IntConsumer result) { WorldUtil.IMP.getHighestBlock(world, x, z, highest -> { if (highest == 0) { result.accept(63); diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/WorldUtil.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/WorldUtil.java index d83c95c27..63cc5c44d 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/WorldUtil.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/WorldUtil.java @@ -26,6 +26,7 @@ import java.util.Map; import java.util.Set; import java.util.UUID; import java.util.function.Consumer; +import java.util.function.IntConsumer; import java.util.zip.GZIPInputStream; import java.util.zip.GZIPOutputStream; import java.util.zip.ZipEntry; @@ -74,7 +75,7 @@ public abstract class WorldUtil { @Deprecated public abstract BlockState getBlockSynchronous(Location location); - public abstract void getHighestBlock(String world, int x, int z, final Consumer result); + public abstract void getHighestBlock(String world, int x, int z, final IntConsumer result); /** * @deprecated May result in synchronous chunk loading