diff --git a/Spigot-API-Patches/Add-Heightmap-API.patch b/Spigot-API-Patches/Add-Heightmap-API.patch index b65ac1d84..9fde12961 100644 --- a/Spigot-API-Patches/Add-Heightmap-API.patch +++ b/Spigot-API-Patches/Add-Heightmap-API.patch @@ -3,7 +3,7 @@ From: Spottedleaf Date: Sat, 1 Dec 2018 19:00:36 -0800 Subject: [PATCH] Add Heightmap API -Deprecated 2020-02-08 MC 1.15.2 +Changed to use upstream's heightmap API - Machine_Maker diff --git a/src/main/java/com/destroystokyo/paper/HeightmapType.java b/src/main/java/com/destroystokyo/paper/HeightmapType.java new file mode 100644 @@ -67,7 +67,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + */ + @NotNull + public Location toHighestLocation() { -+ return this.toHighestLocation(com.destroystokyo.paper.HeightmapType.LIGHT_BLOCKING); ++ return this.toHighestLocation(HeightMap.WORLD_SURFACE); + } + + /** @@ -76,13 +76,27 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + * @return A copy of this location except with y = getWorld().getHighestBlockYAt(this.getBlockX(), this.getBlockZ(), heightmap) + * @throws NullPointerException if {{@link #getWorld()}} is {@code null} + * @throws UnsupportedOperationException if {@link World#getHighestBlockYAt(int, int, com.destroystokyo.paper.HeightmapType)} does not support the specified heightmap ++ * @deprecated Use {@link org.bukkit.Location#toHighestLocation(HeightMap)} + */ + @NotNull ++ @Deprecated + public Location toHighestLocation(@NotNull final com.destroystokyo.paper.HeightmapType heightmap) { + final Location ret = this.clone(); + ret.setY(this.getWorld().getHighestBlockYAt(this, heightmap)); + return ret; + } ++ ++ /** ++ * Returns a copy of this location except with y = getWorld().getHighestBlockYAt(this.getBlockX(), this.getBlockZ(), heightMap) ++ * @param heightMap The heightmap to use for finding the highest y location. ++ * @return A copy of this location except with y = getWorld().getHighestBlockYAt(this.getBlockX(), this.getBlockZ(), heightMap) ++ */ ++ @NotNull ++ public Location toHighestLocation(@NotNull final HeightMap heightMap) { ++ final Location ret = this.clone(); ++ ret.setY(this.getWorld().getHighestBlockYAt(this, heightMap)); ++ return ret; ++ } + // Paper end + /**