mirror of
https://github.com/PaperMC/Paper.git
synced 2025-02-03 14:11:27 +01:00
Target more sync loads (#2476)
This commit is contained in:
parent
45ed30b235
commit
e5f584cf6b
@ -280,9 +280,26 @@ index 69f3159ce..17f04fb81 100644
|
||||
this.serverThreadQueue.awaitTasks(completablefuture::isDone);
|
||||
com.destroystokyo.paper.io.chunk.ChunkTaskManager.popChunkWait(); // Paper - async chunk debug
|
||||
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
|
||||
index b81b37445..d3a0ed52b 100644
|
||||
index b81b37445..9d29fc8ca 100644
|
||||
--- a/src/main/java/net/minecraft/server/World.java
|
||||
+++ b/src/main/java/net/minecraft/server/World.java
|
||||
@@ -0,0 +0,0 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
|
||||
}
|
||||
|
||||
public boolean n(BlockPosition blockposition) {
|
||||
- return isOutsideWorld(blockposition) ? false : this.chunkProvider.b(blockposition.getX() >> 4, blockposition.getZ() >> 4);
|
||||
+ return isOutsideWorld(blockposition) ? false : this.isLoaded(blockposition); // Paper - reduce sync loads
|
||||
}
|
||||
|
||||
public boolean a(BlockPosition blockposition, Entity entity) {
|
||||
if (isOutsideWorld(blockposition)) {
|
||||
return false;
|
||||
} else {
|
||||
- IChunkAccess ichunkaccess = this.getChunkAt(blockposition.getX() >> 4, blockposition.getZ() >> 4, ChunkStatus.FULL, false);
|
||||
+ IChunkAccess ichunkaccess = this.getChunkIfLoadedImmediately(blockposition.getX() >> 4, blockposition.getZ() >> 4); // Paper - reduce sync loads
|
||||
|
||||
return ichunkaccess == null ? false : ichunkaccess.getType(blockposition).a((IBlockAccess) this, blockposition, entity);
|
||||
}
|
||||
@@ -0,0 +0,0 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
|
||||
|
||||
for (int i1 = i; i1 <= j; ++i1) {
|
||||
@ -310,4 +327,21 @@ index b81b37445..d3a0ed52b 100644
|
||||
|
||||
if (chunk != null) {
|
||||
chunk.a(oclass, axisalignedbb, list, predicate);
|
||||
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
|
||||
index 0c1f4e6e1..845575f52 100644
|
||||
--- a/src/main/java/net/minecraft/server/WorldServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/WorldServer.java
|
||||
@@ -0,0 +0,0 @@ public class WorldServer extends World {
|
||||
};
|
||||
public final com.destroystokyo.paper.io.chunk.ChunkTaskManager asyncChunkTaskManager;
|
||||
// Paper end
|
||||
+ // Paper start
|
||||
+ @Override
|
||||
+ public boolean isChunkLoaded(int x, int z) {
|
||||
+ return this.getChunkProvider().getChunkAtIfCachedImmediately(x, z) != null;
|
||||
+ }
|
||||
+ // Paper end
|
||||
|
||||
// Add env and gen to constructor
|
||||
public WorldServer(MinecraftServer minecraftserver, Executor executor, WorldNBTStorage worldnbtstorage, WorldData worlddata, DimensionManager dimensionmanager, GameProfilerFiller gameprofilerfiller, WorldLoadListener worldloadlistener, org.bukkit.World.Environment env, org.bukkit.generator.ChunkGenerator gen) {
|
||||
--
|
@ -757,7 +757,7 @@ index c6ea37ffb..9d4a96ae4 100644
|
||||
|
||||
@Nullable
|
||||
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
|
||||
index 0c1f4e6e1..4ffcb15af 100644
|
||||
index 845575f52..ee3789b38 100644
|
||||
--- a/src/main/java/net/minecraft/server/WorldServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/WorldServer.java
|
||||
@@ -0,0 +0,0 @@ public class WorldServer extends World {
|
||||
|
Loading…
Reference in New Issue
Block a user