From 1975fbe3686be68d80bcfff4a4478afe45a3df10 Mon Sep 17 00:00:00 2001 From: Owen <23108066+Owen1212055@users.noreply.github.com> Date: Sun, 25 Dec 2022 23:22:08 -0500 Subject: [PATCH] Respect SpigotConfig logCommands & fix stopDancing() NPE (#8715) --- ...ssing-SpigotConfig-logCommands-check.patch | 20 +++++++++++++++++++ ...-Allay-stopDancing-while-not-dancing.patch | 19 ++++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 patches/server/0952-Add-missing-SpigotConfig-logCommands-check.patch create mode 100644 patches/server/0953-Fix-NPE-on-Allay-stopDancing-while-not-dancing.patch diff --git a/patches/server/0952-Add-missing-SpigotConfig-logCommands-check.patch b/patches/server/0952-Add-missing-SpigotConfig-logCommands-check.patch new file mode 100644 index 0000000000..a6263d36bc --- /dev/null +++ b/patches/server/0952-Add-missing-SpigotConfig-logCommands-check.patch @@ -0,0 +1,20 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: NonSwag +Date: Thu, 8 Dec 2022 20:25:05 +0100 +Subject: [PATCH] Add missing SpigotConfig logCommands check + + +diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +index 08cb3db28f13c352a162009deeb28ee637e98d2a..50d8d16b1856c0c875ccabbcfc240379a7669559 100644 +--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java ++++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +@@ -2256,7 +2256,9 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic + private void performChatCommand(ServerboundChatCommandPacket packet, LastSeenMessages lastSeenMessages) { + // CraftBukkit start + String command = "/" + packet.command(); ++ if (org.spigotmc.SpigotConfig.logCommands) { // Paper + ServerGamePacketListenerImpl.LOGGER.info(this.player.getScoreboardName() + " issued server command: " + command); ++ } // Paper + + PlayerCommandPreprocessEvent event = new PlayerCommandPreprocessEvent(this.getCraftPlayer(), command, new LazyPlayerSet(this.server)); + this.cserver.getPluginManager().callEvent(event); diff --git a/patches/server/0953-Fix-NPE-on-Allay-stopDancing-while-not-dancing.patch b/patches/server/0953-Fix-NPE-on-Allay-stopDancing-while-not-dancing.patch new file mode 100644 index 0000000000..f489d25fad --- /dev/null +++ b/patches/server/0953-Fix-NPE-on-Allay-stopDancing-while-not-dancing.patch @@ -0,0 +1,19 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: NonSwag +Date: Tue, 6 Dec 2022 23:04:21 +0100 +Subject: [PATCH] Fix NPE on Allay#stopDancing while not dancing + + +diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftAllay.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftAllay.java +index db3b0a9d3696f31d473342312d437e1eae97404a..6dfb0b47bd77fa4584744b3a54267879521b540a 100644 +--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftAllay.java ++++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftAllay.java +@@ -83,7 +83,7 @@ public class CraftAllay extends CraftCreature implements org.bukkit.entity.Allay + public void stopDancing() { + this.getHandle().forceDancing = false; + this.getHandle().jukeboxPos = null; +- this.getHandle().setJukeboxPlaying(null, false); ++ this.getHandle().setDancing(false); // Paper - Directly modify set dancing to avoid NPE + } + + @Override