diff --git a/paper-server/patches/sources/net/minecraft/server/level/ServerPlayer.java.patch b/paper-server/patches/sources/net/minecraft/server/level/ServerPlayer.java.patch index 611ea70de17b..0081fa550b14 100644 --- a/paper-server/patches/sources/net/minecraft/server/level/ServerPlayer.java.patch +++ b/paper-server/patches/sources/net/minecraft/server/level/ServerPlayer.java.patch @@ -694,10 +694,15 @@ } public boolean isReceivingWaypoints() { -@@ -1057,6 +_,19 @@ - this.connection.send(new ClientboundPostEffectsPacket(this.postEffects)); - } +@@ -1054,8 +_,21 @@ + public void sendPostEffects() { + this.postEffectsDirty = false; +- this.connection.send(new ClientboundPostEffectsPacket(this.postEffects)); +- } ++ this.connection.send(new ClientboundPostEffectsPacket(List.copyOf(this.postEffects))); // Paper - Prevent CME race conditions ++ } ++ + // Paper start - Post effects API + public boolean setPostEffects(final Collection postEffects) { + if (com.google.common.collect.Iterables.elementsEqual(this.postEffects, postEffects)) { @@ -710,10 +715,9 @@ + return true; + } + // Paper end - Post effects API -+ + public boolean addPostEffect(final Identifier postEffect) { if (this.postEffects.contains(postEffect)) { - return false; @@ -1103,15 +_,17 @@ if (block instanceof RespawnAnchorBlock && (forced || blockState.getValue(RespawnAnchorBlock.CHARGE) > 0) && RespawnAnchorBlock.canSetSpawn(level, pos) )