mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-17 16:37:43 +01:00
Upstream has released updates that appear to apply and compile correctly Paper Changes: PaperMC/Paper@e574412 Replace ConfiguredStructure api with Structure (#8642) PaperMC/Paper@a172880 Update ForgeFlower to 2.0.627.2, fixes dev bundle not applying with Java 19 runtime PaperMC/Paper@4151f75 /paper entity list QOL improvements (#8876) PaperMC/Paper@8a815a0 Fix rendering for translatable death messages (#8534) PaperMC/Paper@d30cda1 Add TeleportFlags (#8855) PaperMC/Paper@3dcf4e4 Add EntityFertilizeEggEvent (#8041) PaperMC/Paper@f2075c4 Take in account waterlogged block for the event (#8623) PaperMC/Paper@e5e75dd Include previous spawn angle in SpawnChangeEvent (#8606) PaperMC/Paper@541753b Fix HumanEntity#drop not updating the client inventory (#6761)
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 9ea6210439d680d550b661783874e21cd92b6422..83571abfe9a2eb8736b481de35dfd7fd4c663f5a 100644
|
|
--- a/src/main/java/org/bukkit/Bukkit.java
|
|
+++ b/src/main/java/org/bukkit/Bukkit.java
|
|
@@ -2502,5 +2502,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 2b64836fcfd22c7b11030aca4de44784440e285b..e0f69edf603c2ec99bc92b16b18912272cc41bd9 100644
|
|
--- a/src/main/java/org/bukkit/Server.java
|
|
+++ b/src/main/java/org/bukkit/Server.java
|
|
@@ -2181,5 +2181,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 bb249f7d54fd90d63f609eedf0bbb463f1aa96f1..a38863ebd363f54994753937a10e041076846af0 100644
|
|
--- a/src/main/java/org/bukkit/World.java
|
|
+++ b/src/main/java/org/bukkit/World.java
|
|
@@ -4018,6 +4018,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 d713b34a5c57468530f2a7f8d3838d95fc1b01df..98210502756b828bd48897e241d8e7edc0227c9f 100644
|
|
--- a/src/main/java/org/bukkit/entity/Player.java
|
|
+++ b/src/main/java/org/bukkit/entity/Player.java
|
|
@@ -3026,5 +3026,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
|
|
}
|