mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-05 10:20:53 +01:00
18c3716c49
This enables us a fast reference to the entities current chunk instead of having to look it up by hashmap lookups. We also store counts by type to further enable other performance optimizations in later patches.
34 lines
1.3 KiB
Diff
34 lines
1.3 KiB
Diff
From 98af7220cc151b5d19148fabfc24c66f15fca41c Mon Sep 17 00:00:00 2001
|
|
From: Aikar <aikar@aikar.co>
|
|
Date: Tue, 5 Apr 2016 19:42:22 -0400
|
|
Subject: [PATCH] Don't spam reload spawn chunks in nether/end
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
|
|
index 1189720de..ad422b24b 100644
|
|
--- a/src/main/java/net/minecraft/server/World.java
|
|
+++ b/src/main/java/net/minecraft/server/World.java
|
|
@@ -3196,6 +3196,7 @@ public abstract class World implements IBlockAccess {
|
|
return this.P;
|
|
}
|
|
|
|
+ public boolean shouldStayLoaded(int i, int j) { return e(i, j); } // Paper - OBFHELPER
|
|
public boolean e(int i, int j) {
|
|
BlockPosition blockposition = this.getSpawn();
|
|
int k = i * 16 + 8 - blockposition.getX();
|
|
diff --git a/src/main/java/net/minecraft/server/WorldProvider.java b/src/main/java/net/minecraft/server/WorldProvider.java
|
|
index d0265f960..35d8d1a6e 100644
|
|
--- a/src/main/java/net/minecraft/server/WorldProvider.java
|
|
+++ b/src/main/java/net/minecraft/server/WorldProvider.java
|
|
@@ -138,6 +138,6 @@ public abstract class WorldProvider {
|
|
public void s() {}
|
|
|
|
public boolean c(int i, int j) {
|
|
- return true;
|
|
+ return !this.b.shouldStayLoaded(i, j); // Paper - Use shouldStayLoaded check for all worlds
|
|
}
|
|
}
|
|
--
|
|
2.18.0
|
|
|