@@ -8,7 +8,7 @@ Now in 1.17, this state is _even more_ critical than it was before,
8
8
so these must exist to catch stupid plugins.
9
9
10
10
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
12
12
--- a/src/main/java/net/minecraft/world/level/entity/PersistentEntitySectionManager.java
13
13
+++ b/src/main/java/net/minecraft/world/level/entity/PersistentEntitySectionManager.java
14
14
@@ -134,6 +134,7 @@ public class PersistentEntitySectionManager<T extends EntityAccess> implements A
@@ -59,14 +59,14 @@ index fe5739c0949636343ea68e403aa5f4bef89e9d9f..394de90cc25179cd7576af9a08214b0d
59
59
long i = chunkPos.toLong();
60
60
61
61
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
+
63
64
private boolean storeChunkSections(long chunkPos, Consumer<T> action, boolean callEvent) {
64
65
// CraftBukkit end
65
- PersistentEntitySectionManager.ChunkLoadStatus persistententitysectionmanager_b = (PersistentEntitySectionManager.ChunkLoadStatus) this.chunkLoadStatuses.get(chunkPos);
66
66
+ org.spigotmc.AsyncCatcher.catchOp("Entity chunk save"); // Paper
67
+ PersistentEntitySectionManager.ChunkLoadStatus persistententitysectionmanager_b = (PersistentEntitySectionManager.ChunkLoadStatus) this.chunkLoadStatuses.get(chunkPos);
67
68
68
69
if (persistententitysectionmanager_b == PersistentEntitySectionManager.ChunkLoadStatus.PENDING) {
69
- return false;
70
70
@@ -320,6 +328,7 @@ public class PersistentEntitySectionManager<T extends EntityAccess> implements A
71
71
}
72
72
@@ -75,14 +75,14 @@ index fe5739c0949636343ea68e403aa5f4bef89e9d9f..394de90cc25179cd7576af9a08214b0d
75
75
this.chunkLoadStatuses.put(chunkPos, PersistentEntitySectionManager.ChunkLoadStatus.PENDING);
76
76
ChunkPos chunkcoordintpair = new ChunkPos(chunkPos);
77
77
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
+ }
79
80
80
81
private boolean processChunkUnload(long chunkPos) {
81
- boolean flag = this.storeChunkSections(chunkPos, (entityaccess) -> {
82
82
+ org.spigotmc.AsyncCatcher.catchOp("Entity chunk unload process"); // Paper
83
+ boolean flag = this.storeChunkSections(chunkPos, (entityaccess) -> {
83
84
entityaccess.getPassengersAndSelf().forEach(this::unloadEntity);
84
85
}, true); // CraftBukkit - add boolean for event call
85
-
86
86
@@ -357,6 +367,7 @@ public class PersistentEntitySectionManager<T extends EntityAccess> implements A
87
87
}
88
88
0 commit comments