Fix issue with chunk caching patch

This commit is contained in:
Ammar Askar 2013-08-03 20:34:40 +05:00
parent 69cbbd9844
commit 93d4dc070a
1 changed files with 11 additions and 4 deletions

View File

@ -6,7 +6,7 @@ Subject: [PATCH] Entity ticking chunk caching
Cache known loaded chunks so we avoid making a potentially expensive contains call for every single entity in exchange for some simple arithmetic. Best case scenario, this cuts down contains call to once per chunk, worst case it adds on some simple arithmetic operations Cache known loaded chunks so we avoid making a potentially expensive contains call for every single entity in exchange for some simple arithmetic. Best case scenario, this cuts down contains call to once per chunk, worst case it adds on some simple arithmetic operations
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index 8bd7876..ba1c1ca 100644 index 8bd7876..52694f1 100644
--- a/src/main/java/net/minecraft/server/World.java --- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java
@@ -1221,6 +1221,7 @@ public abstract class World implements IBlockAccess { @@ -1221,6 +1221,7 @@ public abstract class World implements IBlockAccess {
@ -57,10 +57,17 @@ index 8bd7876..ba1c1ca 100644
+ } + }
} }
// CraftBukkit end // CraftBukkit end
+ lastChunk = Long.MIN_VALUE; // Spigot + lastChunk = chunk; // Spigot
if (entity.vehicle != null) { if (entity.vehicle != null) {
if (!entity.vehicle.dead && entity.vehicle.passenger == entity) { if (!entity.vehicle.dead && entity.vehicle.passenger == entity) {
@@ -1326,6 +1338,7 @@ public abstract class World implements IBlockAccess {
this.methodProfiler.b();
}
+ lastChunk = Long.MIN_VALUE; // Spigot
timings.entityTick.stopTiming(); // Spigot
this.methodProfiler.c("tileEntities");
-- --
1.8.1.2 1.8.1.msysgit.1