mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-17 16:37:43 +01:00
drop exact choice recipe book clicks patch, supercedes #1446
not sure how i missed this when upstreaming
This commit is contained in:
@@ -1,148 +0,0 @@
|
||||
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 12b25d353990b6bcca3772c07ebe6472944b3166..c600c3579747281a7e463ea4dcb9335d8936f2e3 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -1543,6 +1543,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 791e69b2c963cd034d6d35561448cdb20b1b1cde..52b48e40c3ee5f483c6cb04409459cf25abc3f0d 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
@@ -2293,6 +2293,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 19f6bad1b81c5a5c249631b43e1f6c159dc994e0..3c543e3972035e0c7a1c93e2f881e2ab0205afa0 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
@@ -3335,5 +3335,43 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
public void resetIdleTimer() {
|
||||
getHandle().resetLastActionTime();
|
||||
}
|
||||
+
|
||||
+ @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;
|
||||
+ this.getHandle().connection.send(new net.minecraft.network.protocol.common.ClientboundCustomPayloadPacket(new net.minecraft.network.protocol.common.custom.GameTestAddMarkerDebugPayload(io.papermc.paper.util.MCUtil.toBlockPosition(location), argb, text, 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() {
|
||||
+ if (this.getHandle().connection == null) return;
|
||||
+ this.getHandle().connection.send(new net.minecraft.network.protocol.common.ClientboundCustomPayloadPacket(new net.minecraft.network.protocol.common.custom.GameTestClearMarkersDebugPayload()));
|
||||
+ }
|
||||
// Purpur end
|
||||
}
|
||||
Reference in New Issue
Block a user