aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0835-Async-catch-modifications-to-critical-entity-state.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patches/server/0835-Async-catch-modifications-to-critical-entity-state.patch')
-rw-r--r--patches/server/0835-Async-catch-modifications-to-critical-entity-state.patch16
1 files changed, 8 insertions, 8 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 b7ffa8fa7a..572a2eecf9 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 ea6d16d36cc98c0de5ad9d8faa8cbd8984fb309d..8634cf852d7ecb70c7bac6ad7f606aed1347f61d 100644
+index fe5739c0949636343ea68e403aa5f4bef89e9d9f..394de90cc25179cd7576af9a08214b0d4ad53795 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<T extends EntityAccess> implements A
@@ -59,14 +59,14 @@ index ea6d16d36cc98c0de5ad9d8faa8cbd8984fb309d..8634cf852d7ecb70c7bac6ad7f606aed
long i = chunkPos.toLong();
if (trackingStatus == Visibility.HIDDEN) {
-@@ -291,6 +298,7 @@ public class PersistentEntitySectionManager<T extends EntityAccess> implements A
-
- private boolean a(long i, Consumer<T> consumer, boolean callEvent) {
+@@ -292,6 +299,7 @@ public class PersistentEntitySectionManager<T extends EntityAccess> implements A
+ private boolean storeChunkSections(long chunkPos, Consumer<T> 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(i);
if (persistententitysectionmanager_b == PersistentEntitySectionManager.ChunkLoadStatus.PENDING) {
+ return false;
@@ -320,6 +328,7 @@ public class PersistentEntitySectionManager<T extends EntityAccess> implements A
}
@@ -75,14 +75,14 @@ index ea6d16d36cc98c0de5ad9d8faa8cbd8984fb309d..8634cf852d7ecb70c7bac6ad7f606aed
this.chunkLoadStatuses.put(chunkPos, PersistentEntitySectionManager.ChunkLoadStatus.PENDING);
ChunkPos chunkcoordintpair = new ChunkPos(chunkPos);
CompletableFuture completablefuture = this.permanentStorage.loadEntities(chunkcoordintpair);
-@@ -333,6 +342,7 @@ public class PersistentEntitySectionManager<T extends EntityAccess> implements A
- }
+@@ -334,6 +343,7 @@ public class PersistentEntitySectionManager<T extends EntityAccess> 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.a(chunkPos, (entityaccess) -> {
entityaccess.getPassengersAndSelf().forEach(this::unloadEntity);
}, true); // CraftBukkit - add boolean for event call
+
@@ -357,6 +367,7 @@ public class PersistentEntitySectionManager<T extends EntityAccess> implements A
}