From 1ca237423e98461b6ee7625119fd63acd395beeb Mon Sep 17 00:00:00 2001 From: Bukkit/Spigot Date: Thu, 11 May 2023 06:48:38 +1000 Subject: [PATCH] #854: Move getHighestBlockYAt methods from World to RegionAccessor By: Jishuna --- .../main/java/org/bukkit/RegionAccessor.java | 45 +++++++++++++++++++ paper-api/src/main/java/org/bukkit/World.java | 45 ------------------- 2 files changed, 45 insertions(+), 45 deletions(-) diff --git a/paper-api/src/main/java/org/bukkit/RegionAccessor.java b/paper-api/src/main/java/org/bukkit/RegionAccessor.java index a89fff5c16..43f5aab2fe 100644 --- a/paper-api/src/main/java/org/bukkit/RegionAccessor.java +++ b/paper-api/src/main/java/org/bukkit/RegionAccessor.java @@ -348,4 +348,49 @@ public interface RegionAccessor { */ @NotNull public T spawn(@NotNull Location location, @NotNull Class clazz, boolean randomizeData, @Nullable Consumer function) throws IllegalArgumentException; + + /** + * Gets the highest non-empty (impassable) coordinate at the given + * coordinates. + * + * @param x X-coordinate of the blocks + * @param z Z-coordinate of the blocks + * @return Y-coordinate of the highest non-empty block + */ + public int getHighestBlockYAt(int x, int z); + + /** + * Gets the highest non-empty (impassable) coordinate at the given + * {@link Location}. + * + * @param location Location of the blocks + * @return Y-coordinate of the highest non-empty block + */ + public int getHighestBlockYAt(@NotNull Location location); + + /** + * Gets the highest coordinate corresponding to the {@link HeightMap} at the + * given coordinates. + * + * @param x X-coordinate of the blocks + * @param z Z-coordinate of the blocks + * @param heightMap the heightMap that is used to determine the highest + * point + * + * @return Y-coordinate of the highest block corresponding to the + * {@link HeightMap} + */ + public int getHighestBlockYAt(int x, int z, @NotNull HeightMap heightMap); + + /** + * Gets the highest coordinate corresponding to the {@link HeightMap} at the + * given {@link Location}. + * + * @param location Location of the blocks + * @param heightMap the heightMap that is used to determine the highest + * point + * @return Y-coordinate of the highest block corresponding to the + * {@link HeightMap} + */ + public int getHighestBlockYAt(@NotNull Location location, @NotNull HeightMap heightMap); } diff --git a/paper-api/src/main/java/org/bukkit/World.java b/paper-api/src/main/java/org/bukkit/World.java index 5bc173fba9..8ac2339eb2 100644 --- a/paper-api/src/main/java/org/bukkit/World.java +++ b/paper-api/src/main/java/org/bukkit/World.java @@ -65,25 +65,6 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient @NotNull public Block getBlockAt(@NotNull Location location); - /** - * Gets the highest non-empty (impassable) coordinate at the given - * coordinates. - * - * @param x X-coordinate of the blocks - * @param z Z-coordinate of the blocks - * @return Y-coordinate of the highest non-empty block - */ - public int getHighestBlockYAt(int x, int z); - - /** - * Gets the highest non-empty (impassable) coordinate at the given - * {@link Location}. - * - * @param location Location of the blocks - * @return Y-coordinate of the highest non-empty block - */ - public int getHighestBlockYAt(@NotNull Location location); - /** * Gets the highest non-empty (impassable) block at the given coordinates. * @@ -103,32 +84,6 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient @NotNull public Block getHighestBlockAt(@NotNull Location location); - /** - * Gets the highest coordinate corresponding to the {@link HeightMap} at the - * given coordinates. - * - * @param x X-coordinate of the blocks - * @param z Z-coordinate of the blocks - * @param heightMap the heightMap that is used to determine the highest - * point - * - * @return Y-coordinate of the highest block corresponding to the - * {@link HeightMap} - */ - public int getHighestBlockYAt(int x, int z, @NotNull HeightMap heightMap); - - /** - * Gets the highest coordinate corresponding to the {@link HeightMap} at the - * given {@link Location}. - * - * @param location Location of the blocks - * @param heightMap the heightMap that is used to determine the highest - * point - * @return Y-coordinate of the highest block corresponding to the - * {@link HeightMap} - */ - public int getHighestBlockYAt(@NotNull Location location, @NotNull HeightMap heightMap); - /** * Gets the highest block corresponding to the {@link HeightMap} at the * given coordinates.