From f99330b2aef4aa0e037e5b65a4e686b602d97c85 Mon Sep 17 00:00:00 2001 From: md_5 Date: Tue, 27 Aug 2013 19:17:39 +1000 Subject: [PATCH] Revert "Fix issue with chunk caching patch" This reverts commit 93d4dc070a9be8bbcf4102181cafe06d1d05c182. --- .../0064-Entity-ticking-chunk-caching.patch | 12 ++---------- CraftBukkit-Patches/0069-Guard-entity-list.patch | 10 ++++------ 2 files changed, 6 insertions(+), 16 deletions(-) diff --git a/CraftBukkit-Patches/0064-Entity-ticking-chunk-caching.patch b/CraftBukkit-Patches/0064-Entity-ticking-chunk-caching.patch index bf654e9ef..795cbe9c3 100644 --- a/CraftBukkit-Patches/0064-Entity-ticking-chunk-caching.patch +++ b/CraftBukkit-Patches/0064-Entity-ticking-chunk-caching.patch @@ -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 diff --git a/CraftBukkit-Patches/0069-Guard-entity-list.patch b/CraftBukkit-Patches/0069-Guard-entity-list.patch index 63121b812..b346212ad 100644 --- a/CraftBukkit-Patches/0069-Guard-entity-list.patch +++ b/CraftBukkit-Patches/0069-Guard-entity-list.patch @@ -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 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