Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-11-15 12:30:06 +01:00
ca708a0944
Upstream has released updates that appear to apply and compile correctly. This update has not been tested by PaperMC and as with ANY update, please do your own testing Bukkit Changes: ed7bba95 SPIGOT-6547: Chunk#getEntities() doesn't return all entities immediately after chunk load d99a585c SPIGOT-6719: Add getTileEntities() to LimitedRegion CraftBukkit Changes: 422cec08 Rebuild patch 15f27fc7 SPIGOT-6547: Chunk#getEntities() doesn't return all entities immediately after chunk load cbd747af SPIGOT-6719: Add getTileEntities() to LimitedRegion Spigot Changes: 6c1c1b26 Rebuild patches
45 Zeilen
2.4 KiB
Diff
45 Zeilen
2.4 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Spottedleaf <Spottedleaf@users.noreply.github.com>
|
|
Date: Thu, 15 Jul 2021 01:41:53 -0700
|
|
Subject: [PATCH] Add more async catchers
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/world/level/entity/EntityTickList.java b/src/main/java/net/minecraft/world/level/entity/EntityTickList.java
|
|
index f01182a0ac8a14bcd5b1deb778306e7bf1bf70ed..b27c8db914cca3ff0ea8a24acddb9cb9870ce21d 100644
|
|
--- a/src/main/java/net/minecraft/world/level/entity/EntityTickList.java
|
|
+++ b/src/main/java/net/minecraft/world/level/entity/EntityTickList.java
|
|
@@ -30,11 +30,13 @@ public class EntityTickList {
|
|
}
|
|
|
|
public void add(Entity entity) {
|
|
+ io.papermc.paper.util.TickThread.ensureTickThread("Asynchronous entity ticklist addition"); // Paper
|
|
this.ensureActiveIsNotIterated();
|
|
this.active.put(entity.getId(), entity);
|
|
}
|
|
|
|
public void remove(Entity entity) {
|
|
+ io.papermc.paper.util.TickThread.ensureTickThread("Asynchronous entity ticklist removal"); // Paper
|
|
this.ensureActiveIsNotIterated();
|
|
this.active.remove(entity.getId());
|
|
}
|
|
@@ -44,6 +46,7 @@ public class EntityTickList {
|
|
}
|
|
|
|
public void forEach(Consumer<Entity> action) {
|
|
+ io.papermc.paper.util.TickThread.ensureTickThread("Asynchronous entity ticklist iteration"); // Paper
|
|
if (this.iterated != null) {
|
|
throw new UnsupportedOperationException("Only one concurrent iteration supported");
|
|
} else {
|
|
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 cb6fc8bab2bf4d4b6293ce6e3e62aedadf04b771..0c4ffc0049679b911cc1e1bea36eb21ff6324c46 100644
|
|
--- a/src/main/java/net/minecraft/world/level/entity/PersistentEntitySectionManager.java
|
|
+++ b/src/main/java/net/minecraft/world/level/entity/PersistentEntitySectionManager.java
|
|
@@ -161,6 +161,7 @@ public class PersistentEntitySectionManager<T extends EntityAccess> implements A
|
|
}
|
|
|
|
public void updateChunkStatus(ChunkPos chunkPos, ChunkHolder.FullChunkStatus levelType) {
|
|
+ io.papermc.paper.util.TickThread.ensureTickThread("Asynchronous chunk ticking status update"); // Paper
|
|
Visibility visibility = Visibility.fromFullChunkStatus(levelType);
|
|
|
|
this.updateChunkStatus(chunkPos, visibility);
|