Skip to content

Commit 0968cdd

Browse files
Move async catches back to where they were (#6869)
1 parent 09d50a9 commit 0968cdd

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

patches/server/0835-Async-catch-modifications-to-critical-entity-state.patch

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Now in 1.17, this state is _even more_ critical than it was before,
88
so these must exist to catch stupid plugins.
99

1010
diff --git a/src/main/java/net/minecraft/world/level/entity/PersistentEntitySectionManager.java b/src/main/java/net/minecraft/world/level/entity/PersistentEntitySectionManager.java
11-
index fe5739c0949636343ea68e403aa5f4bef89e9d9f..394de90cc25179cd7576af9a08214b0d4ad53795 100644
11+
index fe5739c0949636343ea68e403aa5f4bef89e9d9f..50916d29c98b988a206a692d2babd0c742f5d085 100644
1212
--- a/src/main/java/net/minecraft/world/level/entity/PersistentEntitySectionManager.java
1313
+++ b/src/main/java/net/minecraft/world/level/entity/PersistentEntitySectionManager.java
1414
@@ -134,6 +134,7 @@ public class PersistentEntitySectionManager<T extends EntityAccess> implements A
@@ -59,14 +59,14 @@ index fe5739c0949636343ea68e403aa5f4bef89e9d9f..394de90cc25179cd7576af9a08214b0d
5959
long i = chunkPos.toLong();
6060

6161
if (trackingStatus == Visibility.HIDDEN) {
62-
@@ -292,6 +299,7 @@ public class PersistentEntitySectionManager<T extends EntityAccess> implements A
62+
@@ -291,6 +298,7 @@ public class PersistentEntitySectionManager<T extends EntityAccess> implements A
63+
6364
private boolean storeChunkSections(long chunkPos, Consumer<T> action, boolean callEvent) {
6465
// CraftBukkit end
65-
PersistentEntitySectionManager.ChunkLoadStatus persistententitysectionmanager_b = (PersistentEntitySectionManager.ChunkLoadStatus) this.chunkLoadStatuses.get(chunkPos);
6666
+ org.spigotmc.AsyncCatcher.catchOp("Entity chunk save"); // Paper
67+
PersistentEntitySectionManager.ChunkLoadStatus persistententitysectionmanager_b = (PersistentEntitySectionManager.ChunkLoadStatus) this.chunkLoadStatuses.get(chunkPos);
6768

6869
if (persistententitysectionmanager_b == PersistentEntitySectionManager.ChunkLoadStatus.PENDING) {
69-
return false;
7070
@@ -320,6 +328,7 @@ public class PersistentEntitySectionManager<T extends EntityAccess> implements A
7171
}
7272

@@ -75,14 +75,14 @@ index fe5739c0949636343ea68e403aa5f4bef89e9d9f..394de90cc25179cd7576af9a08214b0d
7575
this.chunkLoadStatuses.put(chunkPos, PersistentEntitySectionManager.ChunkLoadStatus.PENDING);
7676
ChunkPos chunkcoordintpair = new ChunkPos(chunkPos);
7777
CompletableFuture completablefuture = this.permanentStorage.loadEntities(chunkcoordintpair);
78-
@@ -334,6 +343,7 @@ public class PersistentEntitySectionManager<T extends EntityAccess> implements A
78+
@@ -333,6 +342,7 @@ public class PersistentEntitySectionManager<T extends EntityAccess> implements A
79+
}
7980

8081
private boolean processChunkUnload(long chunkPos) {
81-
boolean flag = this.storeChunkSections(chunkPos, (entityaccess) -> {
8282
+ org.spigotmc.AsyncCatcher.catchOp("Entity chunk unload process"); // Paper
83+
boolean flag = this.storeChunkSections(chunkPos, (entityaccess) -> {
8384
entityaccess.getPassengersAndSelf().forEach(this::unloadEntity);
8485
}, true); // CraftBukkit - add boolean for event call
85-
8686
@@ -357,6 +367,7 @@ public class PersistentEntitySectionManager<T extends EntityAccess> implements A
8787
}
8888

0 commit comments

Comments
 (0)