mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-01 05:47:45 +01:00
Respect SpigotConfig logCommands & fix stopDancing() NPE (#8715)
This commit is contained in:
parent
99fb11f7ea
commit
e794bcecbd
@ -0,0 +1,20 @@
|
|||||||
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
|
From: NonSwag <mrminecraft00@gmail.com>
|
||||||
|
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 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||||
|
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||||
|
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||||
|
@@ -0,0 +0,0 @@ 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);
|
@ -0,0 +1,19 @@
|
|||||||
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
|
From: NonSwag <mrminecraft00@gmail.com>
|
||||||
|
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 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||||
|
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftAllay.java
|
||||||
|
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftAllay.java
|
||||||
|
@@ -0,0 +0,0 @@ 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
|
Loading…
Reference in New Issue
Block a user