Update upstream B/CB

--- work/Bukkit
Submodule work/Bukkit 6a4242cb..337955e3:
  > SPIGOT-5468: Improve Beehive TileEntity API
  > #473: Add an API for passing the heightmap to getHighestBlockAt* method

--- work/CraftBukkit
Submodule work/CraftBukkit 807a677e..708be695:
  > SPIGOT-5468: Improve Beehive TileEntity API
  > #624: Add an API for passing the heightmap to getHighestBlockAt* method
  > MC-135989, SPIGOT-5564: Don't kick players for flight while riptiding

This deprecates the Paper getHighestBlockAt HeightMap APIs now that
Bukkit has added their own. These methods will stick around long enough
for people to migrate. Their API is pretty much the same as ours,
migration should be quick and easy.
This commit is contained in:
Zach Brown 2020-02-08 18:32:48 -06:00
parent 7c1ef0b701
commit f09fed894f
No known key found for this signature in database
GPG key ID: CC9DA35FC5450B76
45 changed files with 204 additions and 191 deletions

View file

@ -1,23 +1,28 @@
From 0de142a12fee06c6dd294d94bbb6351bb727c4f4 Mon Sep 17 00:00:00 2001
From bdfb8acea9f01a1fcceca8598a330c073777ac3e Mon Sep 17 00:00:00 2001
From: Spottedleaf <Spottedleaf@users.noreply.github.com>
Date: Sat, 1 Dec 2018 19:00:36 -0800
Subject: [PATCH] Add Heightmap API
Deprecated 2020-02-08 MC 1.15.2
diff --git a/src/main/java/com/destroystokyo/paper/HeightmapType.java b/src/main/java/com/destroystokyo/paper/HeightmapType.java
new file mode 100644
index 00000000..4cd9b5ed
index 00000000..709e44ea
--- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/HeightmapType.java
@@ -0,0 +1,35 @@
@@ -0,0 +1,39 @@
+package com.destroystokyo.paper;
+
+import org.bukkit.World;
+import org.bukkit.*;
+
+/**
+ * Enumeration of different heightmap types maintained by the server. Generally using these maps is much faster
+ * than using an iterative search for a block in a given x, z coordinate.
+ *
+ * @deprecated Upstream has added their own API for using the game heightmaps. See {@link org.bukkit.HeightMap} and the
+ * non-deprecated getHighestBlock methods on World such as {@link org.bukkit.World#getHighestBlockAt(Location, HeightMap)}.
+ */
+@Deprecated
+public enum HeightmapType {
+
+ /**
@ -84,10 +89,10 @@ index 77d9cd0a..59047503 100644
* Creates explosion at this location with given power
*
diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java
index 23c76976..b46b2719 100644
index d0256af5..5047be15 100644
--- a/src/main/java/org/bukkit/World.java
+++ b/src/main/java/org/bukkit/World.java
@@ -159,6 +159,79 @@ public interface World extends PluginMessageRecipient, Metadatable {
@@ -159,6 +159,87 @@ public interface World extends PluginMessageRecipient, Metadatable {
@NotNull
public Block getHighestBlockAt(@NotNull Location location);
@ -104,9 +109,11 @@ index 23c76976..b46b2719 100644
+ * @param heightmap The specified heightmap to use. See {@link com.destroystokyo.paper.HeightmapType}
+ * @return The highest block's y-coordinate at (x, z) that matches the specified heightmap's conditions.
+ * @throws UnsupportedOperationException If the heightmap type is not supported.
+ * @deprecated Upstream has added support for this, use {@link World#getHighestBlockYAt(int, int, HeightMap)}
+ *
+ * @see com.destroystokyo.paper.HeightmapType
+ */
+ @Deprecated
+ public int getHighestBlockYAt(int x, int z, @NotNull com.destroystokyo.paper.HeightmapType heightmap) throws UnsupportedOperationException;
+
+ /**
@ -121,8 +128,10 @@ index 23c76976..b46b2719 100644
+ * @param heightmap The specified heightmap to use. See {@link com.destroystokyo.paper.HeightmapType}
+ * @return The highest block's y-coordinate at {@code location} that matches the specified heightmap's conditions.
+ * @throws UnsupportedOperationException If the heightmap type is not supported.
+ * @deprecated Upstream has added support for this, use {@link World#getHighestBlockYAt(Location, HeightMap)}
+ * @see com.destroystokyo.paper.HeightmapType
+ */
+ @Deprecated
+ default int getHighestBlockYAt(@NotNull Location location, @NotNull com.destroystokyo.paper.HeightmapType heightmap) throws UnsupportedOperationException {
+ return this.getHighestBlockYAt(location.getBlockX(), location.getBlockZ(), heightmap);
+ }
@ -138,8 +147,10 @@ index 23c76976..b46b2719 100644
+ * @param heightmap The specified heightmap to use. See {@link com.destroystokyo.paper.HeightmapType}
+ * @return The highest {@link Block} at (x, z) that matches the specified heightmap's conditions.
+ * @throws UnsupportedOperationException If the heightmap type is not supported.
+ * @deprecated Upstream has added support for this, use {@link World#getHighestBlockAt(int, int, HeightMap)}
+ * @see com.destroystokyo.paper.HeightmapType
+ */
+ @Deprecated
+ @NotNull
+ default Block getHighestBlockAt(int x, int z, @NotNull com.destroystokyo.paper.HeightmapType heightmap) throws UnsupportedOperationException {
+ return this.getBlockAt(x, this.getHighestBlockYAt(x, z, heightmap), z);
@ -156,8 +167,10 @@ index 23c76976..b46b2719 100644
+ * @param heightmap The specified heightmap to use. See {@link com.destroystokyo.paper.HeightmapType}
+ * @return The highest {@link Block} at {@code location} that matches the specified heightmap's conditions.
+ * @throws UnsupportedOperationException If the heightmap type is not supported.
+ * @deprecated Upstream has added support for this, use {@link World#getHighestBlockAt(Location, HeightMap)}
+ * @see com.destroystokyo.paper.HeightmapType
+ */
+ @Deprecated
+ @NotNull
+ default Block getHighestBlockAt(@NotNull Location location, @NotNull com.destroystokyo.paper.HeightmapType heightmap) throws UnsupportedOperationException {
+ return this.getHighestBlockAt(location.getBlockX(), location.getBlockZ(), heightmap);
@ -165,8 +178,8 @@ index 23c76976..b46b2719 100644
+ // Paper end
+
/**
* Gets the {@link Chunk} at the given coordinates
*
* Gets the highest coordinate corresponding to the {@link HeightMap} at the
* given coordinates.
--
2.25.0.windows.1
2.25.0