Paper/patches/server/0943-Fix-NPE-on-Allay-stopDancing-while-not-dancing.patch
Nassim Jahnke bf92f3e4db
Updated Upstream (Bukkit/CraftBukkit)
Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing

Bukkit Changes:
9153f77e PR-841: Remove incorrect ClickType.CONTROL_DROP from ClickType#isShiftClick
bceda6ab PR-840: Adjust annotations in Display entity interface
a6b85ac3 PR-835: Add Jukebox#hasRecord() and #startPlaying(), clarify #setRecord()

CraftBukkit Changes:
e142fb9fd SPIGOT-7188: ChunkSnapshot biome y coordinate doesn't match chunk biome y coord
eff1743b9 SPIGOT-7313: More accurately edit data on Jukeboxes
2023-03-30 15:40:15 +02: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 0c09acc98d12cdac46b2f51dcce1edbc8890c931..a0fed289f1f6b6addd60ccbd1344ad2c1202c78b 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