2013-04-10 04:36:11 +02:00
From b4cd08b3d500ed538ddffbfc5c6254f20d47f7f5 Mon Sep 17 00:00:00 2001
2013-02-21 05:16:49 +01:00
From: shakytom <tom.roberts00@gmail.com>
Date: Wed, 20 Feb 2013 22:34:38 -0500
Subject: [PATCH] Improved tile entity lookup for chunk sending
Instead of scanning the entire worlds tile entities to find out what tile entities are in the chunk... just use the arraylist of tile entities we already have.
This results in a good reduction of time spent in player ticking.
---
2013-04-10 04:36:11 +02:00
src/main/java/net/minecraft/server/EntityPlayer.java | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
2013-02-21 05:16:49 +01:00
diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java
2013-04-10 04:36:11 +02:00
index eb07d8e..410148f 100644
2013-02-21 05:16:49 +01:00
--- a/src/main/java/net/minecraft/server/EntityPlayer.java
+++ b/src/main/java/net/minecraft/server/EntityPlayer.java
2013-03-19 06:51:45 +01:00
@@ -173,8 +173,9 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
2013-02-21 05:16:49 +01:00
iterator1.remove();
if (chunkcoordintpair != null && this.world.isLoaded(chunkcoordintpair.x << 4, 0, chunkcoordintpair.z << 4)) {
- arraylist.add(this.world.getChunkAt(chunkcoordintpair.x, chunkcoordintpair.z));
- arraylist1.addAll(((WorldServer) this.world).getTileEntities(chunkcoordintpair.x * 16, 0, chunkcoordintpair.z * 16, chunkcoordintpair.x * 16 + 16, 256, chunkcoordintpair.z * 16 + 16));
+ Chunk chunk = this.world.getChunkAt(chunkcoordintpair.x, chunkcoordintpair.z); // Spigot
+ arraylist.add(chunk); // Spigot
+ arraylist1.addAll(chunk.tileEntities.values()); // Spigot
}
}
--
2013-04-10 04:36:11 +02:00
1.8.2.1
2013-02-21 05:16:49 +01:00