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.
23 lines
823 B
Diff
23 lines
823 B
Diff
From a49583a3643759dfa8082967cbb3ff44021d6394 Mon Sep 17 00:00:00 2001
|
|
From: Aikar <aikar@aikar.co>
|
|
Date: Tue, 19 Jan 2016 00:13:19 -0500
|
|
Subject: [PATCH] Do not load chunks for pathfinding
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/ChunkCache.java b/src/main/java/net/minecraft/server/ChunkCache.java
|
|
index 08b986fd7..786d1dd22 100644
|
|
--- a/src/main/java/net/minecraft/server/ChunkCache.java
|
|
+++ b/src/main/java/net/minecraft/server/ChunkCache.java
|
|
@@ -25,7 +25,7 @@ public class ChunkCache implements IBlockAccess {
|
|
|
|
for (l = this.a; l <= j; ++l) {
|
|
for (i1 = this.b; i1 <= k; ++i1) {
|
|
- this.c[l - this.a][i1 - this.b] = world.getChunkAt(l, i1);
|
|
+ this.c[l - this.a][i1 - this.b] = world.getChunkIfLoaded(l, i1); // Paper
|
|
}
|
|
}
|
|
|
|
--
|
|
2.18.0
|
|
|