Skip to content

Commit

Permalink
Don't try to send boss bars to NPCs
Browse files Browse the repository at this point in the history
  • Loading branch information
Malfrador committed Sep 2, 2024
1 parent 55471dd commit 0208089
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions patches/server/0004-Spellbook.patch
Original file line number Diff line number Diff line change
Expand Up @@ -422,6 +422,22 @@ index 0000000000000000000000000000000000000000..7d90eab2af9b1714b18be16bc65d78c5
+ return handlers;
+ }
+}
diff --git a/src/main/java/io/papermc/paper/adventure/BossBarImplementationImpl.java b/src/main/java/io/papermc/paper/adventure/BossBarImplementationImpl.java
index 23bd6d2d8fed5a3491e856f8b875456dd29f8aaf..62f2da32b7954510661adfd6bd02d4337b24f2c8 100644
--- a/src/main/java/io/papermc/paper/adventure/BossBarImplementationImpl.java
+++ b/src/main/java/io/papermc/paper/adventure/BossBarImplementationImpl.java
@@ -25,6 +25,11 @@ public final class BossBarImplementationImpl implements BossBar.Listener, BossBa
}

public void playerShow(final CraftPlayer player) {
+ // Papyrus start - Don't try to show boss bars for NPCs
+ if (!player.getHandle().isRealPlayer) {
+ return;
+ }
+ // Papyrus end
if (this.vanilla == null) {
this.vanilla = new ServerBossEvent(
PaperAdventure.asVanilla(this.bar.name()),
diff --git a/src/main/java/net/minecraft/network/Connection.java b/src/main/java/net/minecraft/network/Connection.java
index a5f9f2542af86ce95fb31887260fd88fc5f84fb2..3c2d75e07e949367cf33ace7178504e79b856552 100644
--- a/src/main/java/net/minecraft/network/Connection.java
Expand Down

0 comments on commit 0208089

Please sign in to comment.