Revert "Fix issue with chunk caching patch"

This reverts commit 93d4dc070a.
This commit is contained in:
md_5 2013-08-27 19:17:39 +10:00
parent cfc141d731
commit f99330b2ae
2 changed files with 6 additions and 16 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
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index 8bd7876..52694f1 100644
index 8bd7876..ba1c1ca 100644
--- a/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 {
@ -57,18 +57,10 @@ index 8bd7876..52694f1 100644
+ }
}
// CraftBukkit end
+ lastChunk = chunk; // Spigot
+ lastChunk = Long.MIN_VALUE; // Spigot
if (entity.vehicle != null) {
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

View File

@ -1,11 +1,11 @@
From a8c4b252bda955ac01b33f738537bbe645d9482a Mon Sep 17 00:00:00 2001
From b39f6fbc48f5566ccaf1045c2d11dbc4e352ed63 Mon Sep 17 00:00:00 2001
From: Ammar Askar <ammar@ammaraskar.com>
Date: Sat, 3 Aug 2013 21:42:00 +0500
Subject: [PATCH] Guard entity list
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index 52694f1..f06a8df 100644
index ba1c1ca..c03e274 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -29,7 +29,25 @@ import org.bukkit.event.weather.ThunderChangeEvent;
@ -51,11 +51,10 @@ index 52694f1..f06a8df 100644
for (i = 0; i < this.entityList.size(); ++i) {
entity = (Entity) this.entityList.get(i);
@@ -1331,14 +1351,16 @@ public abstract class World implements IBlockAccess {
if (entity.ai && this.isChunkLoaded(j, k)) {
@@ -1332,12 +1352,15 @@ public abstract class World implements IBlockAccess {
this.getChunkAt(j, k).b(entity);
}
-
+ guardEntityList = false; // Spigot
this.entityList.remove(i--);
+ guardEntityList = true; // Spigot
@ -64,7 +63,6 @@ index 52694f1..f06a8df 100644
this.methodProfiler.b();
}
lastChunk = Long.MIN_VALUE; // Spigot
+ guardEntityList = false; // Spigot
timings.entityTick.stopTiming(); // Spigot