Upstream merge

By: md_5 <md_5@live.com.au>
This commit is contained in:
Spigot
2013-12-03 15:13:39 +11:00
parent 223fa04f6f
commit 739f396eba
17 changed files with 69 additions and 173 deletions

View File

@@ -1,4 +1,4 @@
From e162863cd42ceef3bd6333aa4c7c05b632b7536e Mon Sep 17 00:00:00 2001
From 5b18671598657ab57b3d4604052bbc09cbeae7b7 Mon Sep 17 00:00:00 2001
From: Ammar Askar <ammar@ammaraskar.com>
Date: Tue, 16 Jul 2013 03:32:32 +0500
Subject: [PATCH] Entity ticking chunk caching
@@ -6,10 +6,10 @@ 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 baa5d55..c4978f6 100644
index 6997d03..b09220f 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -1192,6 +1192,7 @@ public abstract class World implements IBlockAccess {
@@ -1193,6 +1193,7 @@ public abstract class World implements IBlockAccess {
CrashReport crashreport;
CrashReportSystemDetails crashreportsystemdetails;
@@ -17,7 +17,7 @@ index baa5d55..c4978f6 100644
for (i = 0; i < this.i.size(); ++i) {
entity = (Entity) this.i.get(i);
// CraftBukkit start - Fixed an NPE, don't process entities in chunks queued for unload
@@ -1200,10 +1201,15 @@ public abstract class World implements IBlockAccess {
@@ -1201,10 +1202,15 @@ public abstract class World implements IBlockAccess {
}
ChunkProviderServer chunkProviderServer = ((WorldServer) this).chunkProviderServer;
@@ -35,7 +35,7 @@ index baa5d55..c4978f6 100644
try {
++entity.ticksLived;
@@ -1224,6 +1230,7 @@ public abstract class World implements IBlockAccess {
@@ -1225,6 +1231,7 @@ public abstract class World implements IBlockAccess {
this.i.remove(i--);
}
}
@@ -43,7 +43,7 @@ index baa5d55..c4978f6 100644
this.methodProfiler.c("remove");
this.entityList.removeAll(this.f);
@@ -1254,10 +1261,15 @@ public abstract class World implements IBlockAccess {
@@ -1255,10 +1262,15 @@ public abstract class World implements IBlockAccess {
// CraftBukkit start - Don't tick entities in chunks queued for unload
ChunkProviderServer chunkProviderServer = ((WorldServer) this).chunkProviderServer;