From 0968cddbcdf82d4dde0851f38df78c7cc275e6b9 Mon Sep 17 00:00:00 2001 From: Jake Potrebic <15055071+Machine-Maker@users.noreply.github.com> Date: Thu, 4 Nov 2021 11:20:14 -0700 Subject: [PATCH] Move async catches back to where they were (#6869) --- ...ch-modifications-to-critical-entity-state.patch | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/patches/server/0835-Async-catch-modifications-to-critical-entity-state.patch b/patches/server/0835-Async-catch-modifications-to-critical-entity-state.patch index 572a2eecf..df3726516 100644 --- a/patches/server/0835-Async-catch-modifications-to-critical-entity-state.patch +++ b/patches/server/0835-Async-catch-modifications-to-critical-entity-state.patch @@ -8,7 +8,7 @@ Now in 1.17, this state is _even more_ critical than it was before, so these must exist to catch stupid plugins. diff --git a/src/main/java/net/minecraft/world/level/entity/PersistentEntitySectionManager.java b/src/main/java/net/minecraft/world/level/entity/PersistentEntitySectionManager.java -index fe5739c0949636343ea68e403aa5f4bef89e9d9f..394de90cc25179cd7576af9a08214b0d4ad53795 100644 +index fe5739c0949636343ea68e403aa5f4bef89e9d9f..50916d29c98b988a206a692d2babd0c742f5d085 100644 --- a/src/main/java/net/minecraft/world/level/entity/PersistentEntitySectionManager.java +++ b/src/main/java/net/minecraft/world/level/entity/PersistentEntitySectionManager.java @@ -134,6 +134,7 @@ public class PersistentEntitySectionManager implements A @@ -59,14 +59,14 @@ index fe5739c0949636343ea68e403aa5f4bef89e9d9f..394de90cc25179cd7576af9a08214b0d long i = chunkPos.toLong(); if (trackingStatus == Visibility.HIDDEN) { -@@ -292,6 +299,7 @@ public class PersistentEntitySectionManager implements A +@@ -291,6 +298,7 @@ public class PersistentEntitySectionManager implements A + private boolean storeChunkSections(long chunkPos, Consumer action, boolean callEvent) { // CraftBukkit end - PersistentEntitySectionManager.ChunkLoadStatus persistententitysectionmanager_b = (PersistentEntitySectionManager.ChunkLoadStatus) this.chunkLoadStatuses.get(chunkPos); + org.spigotmc.AsyncCatcher.catchOp("Entity chunk save"); // Paper + PersistentEntitySectionManager.ChunkLoadStatus persistententitysectionmanager_b = (PersistentEntitySectionManager.ChunkLoadStatus) this.chunkLoadStatuses.get(chunkPos); if (persistententitysectionmanager_b == PersistentEntitySectionManager.ChunkLoadStatus.PENDING) { - return false; @@ -320,6 +328,7 @@ public class PersistentEntitySectionManager implements A } @@ -75,14 +75,14 @@ index fe5739c0949636343ea68e403aa5f4bef89e9d9f..394de90cc25179cd7576af9a08214b0d this.chunkLoadStatuses.put(chunkPos, PersistentEntitySectionManager.ChunkLoadStatus.PENDING); ChunkPos chunkcoordintpair = new ChunkPos(chunkPos); CompletableFuture completablefuture = this.permanentStorage.loadEntities(chunkcoordintpair); -@@ -334,6 +343,7 @@ public class PersistentEntitySectionManager implements A +@@ -333,6 +342,7 @@ public class PersistentEntitySectionManager implements A + } private boolean processChunkUnload(long chunkPos) { - boolean flag = this.storeChunkSections(chunkPos, (entityaccess) -> { + org.spigotmc.AsyncCatcher.catchOp("Entity chunk unload process"); // Paper + boolean flag = this.storeChunkSections(chunkPos, (entityaccess) -> { entityaccess.getPassengersAndSelf().forEach(this::unloadEntity); }, true); // CraftBukkit - add boolean for event call - @@ -357,6 +367,7 @@ public class PersistentEntitySectionManager implements A }