mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-18 08:57:44 +01:00
Updated Upstream (Paper)
Upstream has released updates that appear to apply and compile correctly Paper Changes: PaperMC/Paper@de3f149 Fix possible NPE on painting creation (#9391) PaperMC/Paper@fe780d0 Add back accidentally dropped Wandering Trader patch (#9492) PaperMC/Paper@b533905 fix 2 vanilla issues (#8940)
This commit is contained in:
153
patches/server/0274-Debug-Marker-API.patch
Normal file
153
patches/server/0274-Debug-Marker-API.patch
Normal file
@@ -0,0 +1,153 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: YouHaveTrouble <youhavetrouble@youhavetrouble.me>
|
||||
Date: Sat, 23 Jul 2022 14:40:38 +0200
|
||||
Subject: [PATCH] Debug Marker API
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index 2138d98b83bfee76d0c67272b8e10d14f2da7a3f..9ff6d2ae803e4ebab0d76c8eb20b6524b7d77786 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -1541,6 +1541,42 @@ public final class CraftServer implements Server {
|
||||
public void removeFuel(org.bukkit.Material material) {
|
||||
net.minecraft.world.level.block.entity.AbstractFurnaceBlockEntity.removeFuel(net.minecraft.world.item.ItemStack.fromBukkitCopy(new ItemStack(material)));
|
||||
}
|
||||
+
|
||||
+ @Override
|
||||
+ public void sendBlockHighlight(Location location, int duration) {
|
||||
+ sendBlockHighlight(location, duration, "", 0x6400FF00);
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public void sendBlockHighlight(Location location, int duration, int argb) {
|
||||
+ sendBlockHighlight(location, duration, "", argb);
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public void sendBlockHighlight(Location location, int duration, String text) {
|
||||
+ sendBlockHighlight(location, duration, text, 0x6400FF00);
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public void sendBlockHighlight(Location location, int duration, String text, int argb) {
|
||||
+ this.worlds.forEach((name, world) -> world.sendBlockHighlight(location, duration, text, argb));
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public void sendBlockHighlight(Location location, int duration, org.bukkit.Color color, int transparency) {
|
||||
+ sendBlockHighlight(location, duration, "", color, transparency);
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public void sendBlockHighlight(Location location, int duration, String text, org.bukkit.Color color, int transparency) {
|
||||
+ if (transparency < 0 || transparency > 255) throw new IllegalArgumentException("transparency is outside of 0-255 range");
|
||||
+ sendBlockHighlight(location, duration, text, transparency << 24 | color.asRGB());
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public void clearBlockHighlights() {
|
||||
+ this.worlds.forEach((name, world) -> clearBlockHighlights());
|
||||
+ }
|
||||
// Purpur End
|
||||
|
||||
@Override
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
index 4720939d138300ed410871e40d3d2800224a7987..f30c6e09adb3a6aa485357f859fc2a22227350c9 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
@@ -2294,6 +2294,42 @@ public class CraftWorld extends CraftRegionAccessor implements World {
|
||||
public float getLocalDifficultyAt(Location location) {
|
||||
return getHandle().getCurrentDifficultyAt(io.papermc.paper.util.MCUtil.toBlockPosition(location)).getEffectiveDifficulty();
|
||||
}
|
||||
+
|
||||
+ @Override
|
||||
+ public void sendBlockHighlight(Location location, int duration) {
|
||||
+ sendBlockHighlight(location, duration, "", 0x6400FF00);
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public void sendBlockHighlight(Location location, int duration, int argb) {
|
||||
+ sendBlockHighlight(location, duration, "", argb);
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public void sendBlockHighlight(Location location, int duration, String text) {
|
||||
+ sendBlockHighlight(location, duration, text, 0x6400FF00);
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public void sendBlockHighlight(Location location, int duration, String text, int argb) {
|
||||
+ net.minecraft.network.protocol.game.DebugPackets.sendGameTestAddMarker(getHandle(), io.papermc.paper.util.MCUtil.toBlockPosition(location), text, argb, duration);
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public void sendBlockHighlight(Location location, int duration, org.bukkit.Color color, int transparency) {
|
||||
+ sendBlockHighlight(location, duration, "", color, transparency);
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public void sendBlockHighlight(Location location, int duration, String text, org.bukkit.Color color, int transparency) {
|
||||
+ if (transparency < 0 || transparency > 255) throw new IllegalArgumentException("transparency is outside of 0-255 range");
|
||||
+ sendBlockHighlight(location, duration, text, transparency << 24 | color.asRGB());
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public void clearBlockHighlights() {
|
||||
+ net.minecraft.network.protocol.game.DebugPackets.sendGameTestClearPacket(getHandle());
|
||||
+ }
|
||||
// Purpur end
|
||||
|
||||
@Override
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
index 71f86d2461f9f7f49435615c7fdb1724505e52a5..34adc4a82e44c8ecec7a2f21d1df920c80d6f074 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
@@ -3247,5 +3247,48 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
public void setSpawnInvulnerableTicks(int spawnInvulnerableTime) {
|
||||
getHandle().spawnInvulnerableTime = spawnInvulnerableTime;
|
||||
}
|
||||
+
|
||||
+ @Override
|
||||
+ public void sendBlockHighlight(Location location, int duration) {
|
||||
+ sendBlockHighlight(location, duration, "", 0x6400FF00);
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public void sendBlockHighlight(Location location, int duration, int argb) {
|
||||
+ sendBlockHighlight(location, duration, "", argb);
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public void sendBlockHighlight(Location location, int duration, String text) {
|
||||
+ sendBlockHighlight(location, duration, text, 0x6400FF00);
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public void sendBlockHighlight(Location location, int duration, String text, int argb) {
|
||||
+ if (this.getHandle().connection == null) return;
|
||||
+ FriendlyByteBuf buf = new FriendlyByteBuf(Unpooled.buffer());
|
||||
+ buf.writeBlockPos(io.papermc.paper.util.MCUtil.toBlockPosition(location));
|
||||
+ buf.writeInt(argb);
|
||||
+ buf.writeUtf(text);
|
||||
+ buf.writeInt(duration);
|
||||
+ this.getHandle().connection.send(new net.minecraft.network.protocol.game.ClientboundCustomPayloadPacket(ClientboundCustomPayloadPacket.DEBUG_GAME_TEST_ADD_MARKER, buf));
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public void sendBlockHighlight(Location location, int duration, org.bukkit.Color color, int transparency) {
|
||||
+ sendBlockHighlight(location, duration, "", color, transparency);
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public void sendBlockHighlight(Location location, int duration, String text, org.bukkit.Color color, int transparency) {
|
||||
+ if (transparency < 0 || transparency > 255) throw new IllegalArgumentException("transparency is outside of 0-255 range");
|
||||
+ sendBlockHighlight(location, duration, text, transparency << 24 | color.asRGB());
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public void clearBlockHighlights() {
|
||||
+ if (this.getHandle().connection == null) return;
|
||||
+ this.getHandle().connection.send(new net.minecraft.network.protocol.game.ClientboundCustomPayloadPacket(ClientboundCustomPayloadPacket.DEBUG_GAME_TEST_CLEAR, new FriendlyByteBuf(io.netty.buffer.Unpooled.buffer())));
|
||||
+ }
|
||||
// Purpur end
|
||||
}
|
||||
Reference in New Issue
Block a user