@@ -1,4 +1,4 @@
|
||||
From 9d2e1c3bc82d814be967daa62994dcc080384945 Mon Sep 17 00:00:00 2001
|
||||
From 8b366c63f86ae90d9629fdd258d972ec64db1ff8 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 932686f..2f7be96 100644
|
||||
index ec4ce72..6da7de6 100644
|
||||
--- a/src/main/java/net/minecraft/server/World.java
|
||||
+++ b/src/main/java/net/minecraft/server/World.java
|
||||
@@ -1173,6 +1173,7 @@ public abstract class World implements IBlockAccess {
|
||||
@@ -1263,6 +1263,7 @@ public abstract class World implements IBlockAccess {
|
||||
CrashReport crashreport;
|
||||
CrashReportSystemDetails crashreportsystemdetails;
|
||||
|
||||
@@ -17,7 +17,7 @@ index 932686f..2f7be96 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
|
||||
@@ -1181,10 +1182,15 @@ public abstract class World implements IBlockAccess {
|
||||
@@ -1271,10 +1272,15 @@ public abstract class World implements IBlockAccess {
|
||||
}
|
||||
|
||||
ChunkProviderServer chunkProviderServer = ((WorldServer) this).chunkProviderServer;
|
||||
@@ -35,7 +35,7 @@ index 932686f..2f7be96 100644
|
||||
|
||||
try {
|
||||
++entity.ticksLived;
|
||||
@@ -1205,6 +1211,7 @@ public abstract class World implements IBlockAccess {
|
||||
@@ -1295,6 +1301,7 @@ public abstract class World implements IBlockAccess {
|
||||
this.i.remove(i--);
|
||||
}
|
||||
}
|
||||
@@ -43,7 +43,7 @@ index 932686f..2f7be96 100644
|
||||
|
||||
this.methodProfiler.c("remove");
|
||||
this.entityList.removeAll(this.f);
|
||||
@@ -1236,10 +1243,15 @@ public abstract class World implements IBlockAccess {
|
||||
@@ -1326,10 +1333,15 @@ public abstract class World implements IBlockAccess {
|
||||
|
||||
// Don't tick entities in chunks queued for unload
|
||||
ChunkProviderServer chunkProviderServer = ((WorldServer) this).chunkProviderServer;
|
||||
|
||||
Reference in New Issue
Block a user