diff options
author | Bjarne Koll <[email protected]> | 2024-10-21 00:28:50 +0200 |
---|---|---|
committer | Bjarne Koll <[email protected]> | 2024-10-21 00:28:50 +0200 |
commit | fbf7d70b21e634c7a24550832f20bc6525ba68c6 (patch) | |
tree | 089d169ea5732160cbd286d8d8eb008d6540be03 | |
parent | d1393b8ef1a2e9223d92c3c9ad4e638130bc11cb (diff) | |
download | Paper-fbf7d70b21e634c7a24550832f20bc6525ba68c6.tar.gz Paper-fbf7d70b21e634c7a24550832f20bc6525ba68c6.zip |
Guard against plugins offthread packet sending
-rw-r--r-- | patches/server/1068-Always-send-Banner-patterns-to-the-client.patch | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/patches/server/1068-Always-send-Banner-patterns-to-the-client.patch b/patches/server/1068-Always-send-Banner-patterns-to-the-client.patch index ab28662970..78daca3ba4 100644 --- a/patches/server/1068-Always-send-Banner-patterns-to-the-client.patch +++ b/patches/server/1068-Always-send-Banner-patterns-to-the-client.patch @@ -9,7 +9,7 @@ flow for them, this is not all too surprising. So, we shall resort to always sending the patterns over the network for update packets. diff --git a/src/main/java/net/minecraft/world/level/block/entity/BannerBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BannerBlockEntity.java -index 60c26076e7acf869fa0e20fdc14eeec341387d99..41ca62d6b4579c5d7365c4473df82a9dbce4bde1 100644 +index 60c26076e7acf869fa0e20fdc14eeec341387d99..5ddada37ad0d4c19438cd02415bad628012f7c90 100644 --- a/src/main/java/net/minecraft/world/level/block/entity/BannerBlockEntity.java +++ b/src/main/java/net/minecraft/world/level/block/entity/BannerBlockEntity.java @@ -63,7 +63,7 @@ public class BannerBlockEntity extends BlockEntity implements Nameable { @@ -26,16 +26,16 @@ index 60c26076e7acf869fa0e20fdc14eeec341387d99..41ca62d6b4579c5d7365c4473df82a9d } + // Paper start - always send patterns to client -+ boolean serialisingForNetwork = false; ++ ThreadLocal<Boolean> serialisingForNetwork = ThreadLocal.withInitial(() -> Boolean.FALSE); @Override public CompoundTag getUpdateTag(HolderLookup.Provider registryLookup) { - return this.saveWithoutMetadata(registryLookup); -+ boolean wasSerialisingForNetwork = serialisingForNetwork; ++ final Boolean wasSerialisingForNetwork = serialisingForNetwork.get(); + try { -+ serialisingForNetwork = true; ++ serialisingForNetwork.set(Boolean.TRUE); + return this.saveWithoutMetadata(registryLookup); + } finally { -+ serialisingForNetwork = wasSerialisingForNetwork; ++ serialisingForNetwork.set(wasSerialisingForNetwork); + } + // Paper end - always send patterns to client } |