Paper/patches/server/0806-Fix-NPE-on-Allay-stopDancing-while-not-dancing.patch
Riley Park f17519338b
Expose server build information (#10729)
* Expose server build information

* squash patches

* final tweaks

---------

Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com>
Co-authored-by: masmc05 <masmc05@gmail.com>
2024-05-15 17:06:59 -07:00

20 lines
981 B
Diff

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 1d04df8752af74ae73231922041d09df9d7492bb..c64918175ec08d20cde2bda9e0cac8b474385fe0 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftAllay.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftAllay.java
@@ -78,7 +78,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