mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-17 08:27:43 +01:00
Upstream has released updates that appear to apply and compile correctly Paper Changes: PaperMC/Paper@eb0693f Fix EntityDeathEvent cancellation (#9323) PaperMC/Paper@f8cfdd4 Fix SmithingInventory helper slot methods for 1.20 (#9325) PaperMC/Paper@de19eb8 fix incorrectly updated move vector checking patch (#9328) PaperMC/Paper@87dfff4 Implement BossBarViewer on Player (#9332) PaperMC/Paper@2d09115 Use net.kyori.ansi for console logging (#9313) PaperMC/Paper@b48e2e3 Fix dev bundle generation PaperMC/Paper@c287e92 Updated Upstream (Bukkit/CraftBukkit/Spigot) (#9301) PaperMC/Paper@2e363c7 1.20.1 (#9333)
342 lines
16 KiB
Diff
342 lines
16 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: YouHaveTrouble <youhavetrouble@youhavetrouble.me>
|
|
Date: Sat, 23 Jul 2022 14:40:17 +0200
|
|
Subject: [PATCH] Debug Marker API
|
|
|
|
|
|
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
|
|
index ad74599b144d0516eef8baccea3318e5d12913e7..7d759a4725dbea992f078b6c1a60d9822bb268a3 100644
|
|
--- a/src/main/java/org/bukkit/Bukkit.java
|
|
+++ b/src/main/java/org/bukkit/Bukkit.java
|
|
@@ -2538,5 +2538,89 @@ public final class Bukkit {
|
|
public static void removeFuel(@NotNull Material material) {
|
|
server.removeFuel(material);
|
|
}
|
|
+
|
|
+ /**
|
|
+ * 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
|
|
+ */
|
|
+ public static void sendBlockHighlight(@NotNull Location location, int duration) {
|
|
+ server.sendBlockHighlight(location, duration);
|
|
+ }
|
|
+
|
|
+ /**
|
|
+ * 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
|
|
+ * @param argb Color of the highlight. ARGB int. Will be ignored on some versions of vanilla client
|
|
+ */
|
|
+ public static void sendBlockHighlight(@NotNull Location location, int duration, int argb) {
|
|
+ server.sendBlockHighlight(location, duration, argb);
|
|
+ }
|
|
+
|
|
+ /**
|
|
+ * 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
|
|
+ * @param text Text to show above the highlight
|
|
+ */
|
|
+ public static void sendBlockHighlight(@NotNull Location location, int duration, @NotNull String text) {
|
|
+ server.sendBlockHighlight(location, duration, text);
|
|
+ }
|
|
+
|
|
+ /**
|
|
+ * 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
|
|
+ * @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
|
|
+ */
|
|
+ public static void sendBlockHighlight(@NotNull Location location, int duration, @NotNull String text, int argb) {
|
|
+ server.sendBlockHighlight(location, duration, text, argb);
|
|
+ }
|
|
+
|
|
+ /**
|
|
+ * 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
|
|
+ * @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
|
|
+ */
|
|
+ public static void sendBlockHighlight(@NotNull Location location, int duration, @NotNull org.bukkit.Color color, int transparency) {
|
|
+ server.sendBlockHighlight(location, duration, color, transparency);
|
|
+ }
|
|
+
|
|
+ /**
|
|
+ * 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
|
|
+ * @param text Text to show above the highlight
|
|
+ * @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
|
|
+ */
|
|
+ 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.
|
|
+ */
|
|
+ public static void clearBlockHighlights() {
|
|
+ server.clearBlockHighlights();
|
|
+ }
|
|
// Purpur end
|
|
}
|
|
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
|
|
index 4e9305099595c251f5d432c415fe3b60d9335eff..15a0ae9744fa841e3e51e9e9a957cea8c71e68ad 100644
|
|
--- a/src/main/java/org/bukkit/Server.java
|
|
+++ b/src/main/java/org/bukkit/Server.java
|
|
@@ -2217,5 +2217,75 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
|
|
* @param material The material that will no longer be a fuel
|
|
*/
|
|
public void removeFuel(@NotNull Material material);
|
|
+
|
|
+ /**
|
|
+ * 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
|
|
+ */
|
|
+ void sendBlockHighlight(@NotNull Location location, int duration);
|
|
+
|
|
+ /**
|
|
+ * 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
|
|
+ * @param argb Color of the highlight. ARGB int. Will be ignored on some versions of vanilla client
|
|
+ */
|
|
+ void sendBlockHighlight(@NotNull Location location, int duration, int argb);
|
|
+
|
|
+ /**
|
|
+ * 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
|
|
+ * @param text Text to show above the highlight
|
|
+ */
|
|
+ void sendBlockHighlight(@NotNull Location location, int duration, @NotNull String text);
|
|
+
|
|
+ /**
|
|
+ * 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
|
|
+ * @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
|
|
+ */
|
|
+ void sendBlockHighlight(@NotNull Location location, int duration, @NotNull String text, int argb);
|
|
+
|
|
+ /**
|
|
+ * 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
|
|
+ * @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
|
|
+ */
|
|
+ void sendBlockHighlight(@NotNull Location location, int duration, @NotNull org.bukkit.Color color, int transparency);
|
|
+
|
|
+ /**
|
|
+ * 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
|
|
+ * @param text Text to show above the highlight
|
|
+ * @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
|
|
+ */
|
|
+ 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.
|
|
+ */
|
|
+ void clearBlockHighlights();
|
|
// Purpur end
|
|
}
|
|
diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java
|
|
index d07b6f40c111c9b131f2995e9796d66f5344c5df..adf8169d5baefa7a33c33ef066180a8116617756 100644
|
|
--- a/src/main/java/org/bukkit/World.java
|
|
+++ b/src/main/java/org/bukkit/World.java
|
|
@@ -3982,6 +3982,76 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
|
|
* @return The local difficulty
|
|
*/
|
|
public float getLocalDifficultyAt(@NotNull Location location);
|
|
+
|
|
+ /**
|
|
+ * Creates debug block highlight on specified block location and show it to all players on this world.
|
|
+ * <p>
|
|
+ * Clients may be inconsistent in displaying it.
|
|
+ * @param location Location to highlight
|
|
+ * @param duration Duration for highlight to show in milliseconds
|
|
+ */
|
|
+ void sendBlockHighlight(@NotNull Location location, int duration);
|
|
+
|
|
+ /**
|
|
+ * Creates debug block highlight on specified block location and show it to all players on this world.
|
|
+ * <p>
|
|
+ * Clients may be inconsistent in displaying it.
|
|
+ * @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
|
|
+ */
|
|
+ void sendBlockHighlight(@NotNull Location location, int duration, int argb);
|
|
+
|
|
+ /**
|
|
+ * Creates debug block highlight on specified block location and show it to all players on this world.
|
|
+ * <p>
|
|
+ * Clients may be inconsistent in displaying it.
|
|
+ * @param location Location to highlight
|
|
+ * @param duration Duration for highlight to show in milliseconds
|
|
+ * @param text Text to show above the highlight
|
|
+ */
|
|
+ void sendBlockHighlight(@NotNull Location location, int duration, @NotNull String text);
|
|
+
|
|
+ /**
|
|
+ * Creates debug block highlight on specified block location and show it to all players on this world.
|
|
+ * <p>
|
|
+ * Clients may be inconsistent in displaying it.
|
|
+ * @param location Location to highlight
|
|
+ * @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
|
|
+ */
|
|
+ void sendBlockHighlight(@NotNull Location location, int duration, @NotNull String text, int argb);
|
|
+
|
|
+ /**
|
|
+ * Creates debug block highlight on specified block location and show it to all players on this world.
|
|
+ * <p>
|
|
+ * Clients may be inconsistent in displaying it.
|
|
+ * @param location Location to highlight
|
|
+ * @param duration Duration for highlight to show in milliseconds
|
|
+ * @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
|
|
+ */
|
|
+ void sendBlockHighlight(@NotNull Location location, int duration, @NotNull org.bukkit.Color color, int transparency);
|
|
+
|
|
+ /**
|
|
+ * Creates debug block highlight on specified block location and show it to all players on this world.
|
|
+ * <p>
|
|
+ * Clients may be inconsistent in displaying it.
|
|
+ * @param location Location to highlight
|
|
+ * @param duration Duration for highlight to show in milliseconds
|
|
+ * @param text Text to show above the highlight
|
|
+ * @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
|
|
+ */
|
|
+ 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.
|
|
+ */
|
|
+ void clearBlockHighlights();
|
|
// Purpur end
|
|
|
|
/**
|
|
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
|
|
index da270c17ce413e6a75e1007b93dd013be38f0148..e9fe4a91f8d0e64dad18435c89c5cc53e21c0d97 100644
|
|
--- a/src/main/java/org/bukkit/entity/Player.java
|
|
+++ b/src/main/java/org/bukkit/entity/Player.java
|
|
@@ -3135,5 +3135,75 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
|
* @param invulnerableTicks Invulnerable ticks remaining
|
|
*/
|
|
void setSpawnInvulnerableTicks(int invulnerableTicks);
|
|
+
|
|
+ /**
|
|
+ * Creates debug block highlight on specified block location and show it to this player.
|
|
+ * <p>
|
|
+ * Clients may be inconsistent in displaying it.
|
|
+ * @param location Location to highlight
|
|
+ * @param duration Duration for highlight to show in milliseconds
|
|
+ */
|
|
+ void sendBlockHighlight(@NotNull Location location, int duration);
|
|
+
|
|
+ /**
|
|
+ * Creates debug block highlight on specified block location and show it to this player.
|
|
+ * <p>
|
|
+ * Clients may be inconsistent in displaying it.
|
|
+ * @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
|
|
+ */
|
|
+ void sendBlockHighlight(@NotNull Location location, int duration, int argb);
|
|
+
|
|
+ /**
|
|
+ * Creates debug block highlight on specified block location and show it to this player.
|
|
+ * <p>
|
|
+ * Clients may be inconsistent in displaying it.
|
|
+ * @param location Location to highlight
|
|
+ * @param duration Duration for highlight to show in milliseconds
|
|
+ * @param text Text to show above the highlight
|
|
+ */
|
|
+ void sendBlockHighlight(@NotNull Location location, int duration, @NotNull String text);
|
|
+
|
|
+ /**
|
|
+ * Creates debug block highlight on specified block location and show it to this player.
|
|
+ * <p>
|
|
+ * Clients may be inconsistent in displaying it.
|
|
+ * @param location Location to highlight
|
|
+ * @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
|
|
+ */
|
|
+ void sendBlockHighlight(@NotNull Location location, int duration, @NotNull String text, int argb);
|
|
+
|
|
+ /**
|
|
+ * Creates debug block highlight on specified block location and show it to this player.
|
|
+ * <p>
|
|
+ * Clients may be inconsistent in displaying it.
|
|
+ * @param location Location to highlight
|
|
+ * @param duration Duration for highlight to show in milliseconds
|
|
+ * @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
|
|
+ */
|
|
+ void sendBlockHighlight(@NotNull Location location, int duration, @NotNull org.bukkit.Color color, int transparency);
|
|
+
|
|
+ /**
|
|
+ * Creates debug block highlight on specified block location and show it to this player.
|
|
+ * <p>
|
|
+ * Clients may be inconsistent in displaying it.
|
|
+ * @param location Location to highlight
|
|
+ * @param duration Duration for highlight to show in milliseconds
|
|
+ * @param text Text to show above the highlight
|
|
+ * @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
|
|
+ */
|
|
+ void sendBlockHighlight(@NotNull Location location, int duration, @NotNull String text, @NotNull org.bukkit.Color color, int transparency);
|
|
+
|
|
+ /**
|
|
+ * Clears all debug block highlights
|
|
+ */
|
|
+ void clearBlockHighlights();
|
|
// Purpur end
|
|
}
|