Fix NPE on Allay#stopDancing while not dancing

This commit is contained in:
NonSwag 2022-12-06 23:04:21 +01:00
parent bc837647f1
commit d9107f8c61

View file

@ -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