deprecate block highlight api until further notice

This commit is contained in:
granny
2025-11-14 21:45:09 -08:00
parent 2adf3f870b
commit c4bf318106
6 changed files with 51 additions and 9 deletions

View File

@@ -1,6 +1,6 @@
--- a/src/main/java/org/bukkit/Bukkit.java
+++ b/src/main/java/org/bukkit/Bukkit.java
@@ -3003,4 +_,133 @@
@@ -3003,4 +_,147 @@
public static void restart() {
server.restart();
}
@@ -48,14 +48,16 @@
+ }
+ // Purpur end - Added the ability to add combustible items
+
+ // Purpur start - Debug Marker API
+ // Purpur start - Debug Marker API
+ /**
+ * Creates debug block highlight on specified block location and show it to all players on the server.
+ * <p>
+ * Clients may be inconsistent in displaying it.
+ * @param location Location to highlight
+ * @param duration Duration for highlight to show in milliseconds
+ * @deprecated until further notice. NOOP since 1.21.10
+ */
+ @Deprecated
+ public static void sendBlockHighlight(@NotNull Location location, int duration) {
+ server.sendBlockHighlight(location, duration);
+ }
@@ -67,7 +69,9 @@
+ * @param location Location to highlight
+ * @param duration Duration for highlight to show in milliseconds
+ * @param argb Color of the highlight. ARGB int. Will be ignored on some versions of vanilla client
+ * @deprecated until further notice. NOOP since 1.21.10
+ */
+ @Deprecated
+ public static void sendBlockHighlight(@NotNull Location location, int duration, int argb) {
+ server.sendBlockHighlight(location, duration, argb);
+ }
@@ -79,7 +83,9 @@
+ * @param location Location to highlight
+ * @param duration Duration for highlight to show in milliseconds
+ * @param text Text to show above the highlight
+ * @deprecated until further notice. NOOP since 1.21.10
+ */
+ @Deprecated
+ public static void sendBlockHighlight(@NotNull Location location, int duration, @NotNull String text) {
+ server.sendBlockHighlight(location, duration, text);
+ }
@@ -92,7 +98,9 @@
+ * @param duration Duration for highlight to show in milliseconds
+ * @param text Text to show above the highlight
+ * @param argb Color of the highlight. ARGB int. Will be ignored on some versions of vanilla client
+ * @deprecated until further notice. NOOP since 1.21.10
+ */
+ @Deprecated
+ public static void sendBlockHighlight(@NotNull Location location, int duration, @NotNull String text, int argb) {
+ server.sendBlockHighlight(location, duration, text, argb);
+ }
@@ -106,7 +114,9 @@
+ * @param color Color of the highlight. Will be ignored on some versions of vanilla client
+ * @param transparency Transparency of the highlight
+ * @throws IllegalArgumentException If transparency is outside 0-255 range
+ * @deprecated until further notice. NOOP since 1.21.10
+ */
+ @Deprecated
+ public static void sendBlockHighlight(@NotNull Location location, int duration, @NotNull org.bukkit.Color color, int transparency) {
+ server.sendBlockHighlight(location, duration, color, transparency);
+ }
@@ -121,14 +131,18 @@
+ * @param color Color of the highlight. Will be ignored on some versions of vanilla client
+ * @param transparency Transparency of the highlight
+ * @throws IllegalArgumentException If transparency is outside 0-255 range
+ * @deprecated until further notice. NOOP since 1.21.10
+ */
+ @Deprecated
+ public static void sendBlockHighlight(@NotNull Location location, int duration, @NotNull String text, @NotNull org.bukkit.Color color, int transparency) {
+ server.sendBlockHighlight(location, duration, text, color, transparency);
+ }
+
+ /**
+ * Clears all debug block highlights for all players on the server.
+ * @deprecated until further notice. NOOP since 1.21.10
+ */
+ @Deprecated
+ public static void clearBlockHighlights() {
+ server.clearBlockHighlights();
+ }

View File

@@ -1,6 +1,6 @@
--- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java
@@ -2760,4 +_,111 @@
@@ -2760,4 +_,125 @@
*/
void allowPausing(@NotNull org.bukkit.plugin.Plugin plugin, boolean value);
// Paper end - API to check if the server is sleeping
@@ -47,7 +47,9 @@
+ * Clients may be inconsistent in displaying it.
+ * @param location Location to highlight
+ * @param duration Duration for highlight to show in milliseconds
+ * @deprecated until further notice. NOOP since 1.21.10
+ */
+ @Deprecated
+ void sendBlockHighlight(@NotNull Location location, int duration);
+
+ /**
@@ -57,7 +59,9 @@
+ * @param location Location to highlight
+ * @param duration Duration for highlight to show in milliseconds
+ * @param argb Color of the highlight. ARGB int. Will be ignored on some versions of vanilla client
+ * @deprecated until further notice. NOOP since 1.21.10
+ */
+ @Deprecated
+ void sendBlockHighlight(@NotNull Location location, int duration, int argb);
+
+ /**
@@ -67,7 +71,9 @@
+ * @param location Location to highlight
+ * @param duration Duration for highlight to show in milliseconds
+ * @param text Text to show above the highlight
+ * @deprecated until further notice. NOOP since 1.21.10
+ */
+ @Deprecated
+ void sendBlockHighlight(@NotNull Location location, int duration, @NotNull String text);
+
+ /**
@@ -78,7 +84,9 @@
+ * @param duration Duration for highlight to show in milliseconds
+ * @param text Text to show above the highlight
+ * @param argb Color of the highlight. ARGB int. Will be ignored on some versions of vanilla client
+ * @deprecated until further notice. NOOP since 1.21.10
+ */
+ @Deprecated
+ void sendBlockHighlight(@NotNull Location location, int duration, @NotNull String text, int argb);
+
+ /**
@@ -90,7 +98,9 @@
+ * @param color Color of the highlight. Will be ignored on some versions of vanilla client
+ * @param transparency Transparency of the highlight
+ * @throws IllegalArgumentException If transparency is outside 0-255 range
+ * @deprecated until further notice. NOOP since 1.21.10
+ */
+ @Deprecated
+ void sendBlockHighlight(@NotNull Location location, int duration, @NotNull org.bukkit.Color color, int transparency);
+
+ /**
@@ -103,12 +113,16 @@
+ * @param color Color of the highlight. Will be ignored on some versions of vanilla client
+ * @param transparency Transparency of the highlight
+ * @throws IllegalArgumentException If transparency is outside 0-255 range
+ * @deprecated until further notice. NOOP since 1.21.10
+ */
+ @Deprecated
+ void sendBlockHighlight(@NotNull Location location, int duration, @NotNull String text, @NotNull org.bukkit.Color color, int transparency);
+
+ /**
+ * Clears all debug block highlights for all players on the server.
+ * @deprecated until further notice. NOOP since 1.21.10
+ */
+ @Deprecated
+ void clearBlockHighlights();
+ // Purpur end - Debug Marker API
}

View File

@@ -1,6 +1,6 @@
--- a/src/main/java/org/bukkit/World.java
+++ b/src/main/java/org/bukkit/World.java
@@ -4491,6 +_,86 @@
@@ -4491,6 +_,100 @@
@Nullable
public DragonBattle getEnderDragonBattle();
@@ -19,7 +19,9 @@
+ * Clients may be inconsistent in displaying it.
+ * @param location Location to highlight
+ * @param duration Duration for highlight to show in milliseconds
+ * @deprecated until further notice. NOOP since 1.21.10
+ */
+ @Deprecated
+ void sendBlockHighlight(@NotNull Location location, int duration);
+
+ /**
@@ -29,7 +31,9 @@
+ * @param location Location to highlight
+ * @param duration Duration for highlight to show in milliseconds
+ * @param argb Color of the highlight. ARGB int. Will be ignored on some versions of vanilla client
+ * @deprecated until further notice. NOOP since 1.21.10
+ */
+ @Deprecated
+ void sendBlockHighlight(@NotNull Location location, int duration, int argb);
+
+ /**
@@ -39,7 +43,9 @@
+ * @param location Location to highlight
+ * @param duration Duration for highlight to show in milliseconds
+ * @param text Text to show above the highlight
+ * @deprecated until further notice. NOOP since 1.21.10
+ */
+ @Deprecated
+ void sendBlockHighlight(@NotNull Location location, int duration, @NotNull String text);
+
+ /**
@@ -50,7 +56,9 @@
+ * @param duration Duration for highlight to show in milliseconds
+ * @param text Text to show above the highlight
+ * @param argb Color of the highlight. ARGB int. Will be ignored on some versions of vanilla client
+ * @deprecated until further notice. NOOP since 1.21.10
+ */
+ @Deprecated
+ void sendBlockHighlight(@NotNull Location location, int duration, @NotNull String text, int argb);
+
+ /**
@@ -62,7 +70,9 @@
+ * @param color Color of the highlight. Will be ignored on some versions of vanilla client
+ * @param transparency Transparency of the highlight
+ * @throws IllegalArgumentException If transparency is outside 0-255 range
+ * @deprecated until further notice. NOOP since 1.21.10
+ */
+ @Deprecated
+ void sendBlockHighlight(@NotNull Location location, int duration, @NotNull org.bukkit.Color color, int transparency);
+
+ /**
@@ -75,12 +85,16 @@
+ * @param color Color of the highlight. Will be ignored on some versions of vanilla client
+ * @param transparency Transparency of the highlight
+ * @throws IllegalArgumentException If transparency is outside 0-255 range
+ * @deprecated until further notice. NOOP since 1.21.10
+ */
+ @Deprecated
+ void sendBlockHighlight(@NotNull Location location, int duration, @NotNull String text, @NotNull org.bukkit.Color color, int transparency);
+
+ /**
+ * Clears all debug block highlights for all players on this world.
+ * @deprecated until further notice. NOOP since 1.21.10
+ */
+ @Deprecated
+ void clearBlockHighlights();
+ // Purpur end
+

View File

@@ -99,7 +99,7 @@
+
+ @Override
+ public void clearBlockHighlights() {
+ this.worlds.forEach((name, world) -> clearBlockHighlights());
+ this.worlds.forEach((name, world) -> world.clearBlockHighlights());
+ }
+ // Purpur end - Debug Marker API
+

View File

@@ -28,7 +28,7 @@
+
+ @Override
+ public void sendBlockHighlight(Location location, int duration, String text, int argb) {
+ // Purpur - TODO: fix block highlight API
+ // Purpur - TODO: NOOP until further notice
+ //net.minecraft.network.protocol.game.DebugPackets.sendGameTestAddMarker(getHandle(), org.bukkit.craftbukkit.util.CraftLocation.toBlockPosition(location), text, argb, duration);
+ }
+
@@ -45,7 +45,7 @@
+
+ @Override
+ public void clearBlockHighlights() {
+ // Purpur - TODO: fix block highlight API
+ // Purpur - TODO: NOOP until further notice
+ //net.minecraft.network.protocol.game.DebugPackets.sendGameTestClearPacket(getHandle());
+ }
+ // Purpur end - Debug Marker API

View File

@@ -64,7 +64,7 @@
+ @Override
+ public void sendBlockHighlight(Location location, int duration, String text, int argb) {
+ if (this.getHandle().connection == null) return;
+ // Purpur - TODO: fix block highlight API
+ // Purpur - TODO: NOOP until further notice
+ //this.getHandle().connection.send(new net.minecraft.network.protocol.common.ClientboundCustomPayloadPacket(new net.minecraft.network.protocol.common.custom.GameTestAddMarkerDebugPayload(org.bukkit.craftbukkit.util.CraftLocation.toBlockPosition(location), argb, text, duration)));
+ }
+
@@ -82,7 +82,7 @@
+ @Override
+ public void clearBlockHighlights() {
+ if (this.getHandle().connection == null) return;
+ // Purpur - TODO: fix block highlight API
+ // Purpur - TODO: NOOP until further notice
+ //this.getHandle().connection.send(new net.minecraft.network.protocol.common.ClientboundCustomPayloadPacket(new net.minecraft.network.protocol.common.custom.GameTestClearMarkersDebugPayload()));
+ }
+ // Purpur end - Debug Marker API