Mojira Archive
MC-9886

Maps in item frames cause un-necessary lag

Currently, EntityTrackerEntry.track when sending map data for item frames is sending the data to all players in the same world.

Theres 2 issues:
1) The code is using the supplied "list" parameter passed to .track() which includes every player in the current world.

It should actually be using this.trackedPlayers, so that only players in range of the itemframe will receive the data.

2) It is checking the low priority queue for load, which is not used anymore so will always be true.

So on a large server, a single user can setup a large number of maps in item frames and totally destroy the servers performance as it spams the map data to every player in the world.

The main issue can be fixed by simply with CraftBukkit naming:

diff --git a/src/main/java/net/minecraft/server/EntityTrackerEntry.java b/src/main/java/net/minecraft/server/EntityTrackerEntry.java
index c629046..f482f34 100644
--- a/src/main/java/net/minecraft/server/EntityTrackerEntry.java
+++ b/src/main/java/net/minecraft/server/EntityTrackerEntry.java
@@ -80,7 +80,7 @@ public class EntityTrackerEntry {
 
             if (i5 != null && i5.getItem() instanceof ItemWorldMap) {
                 WorldMap i7 = Item.MAP.getSavedMap(i5, this.tracker.world);
-                Iterator j0 = list.iterator();
+                Iterator j0 = this.trackedPlayers.iterator(); // CraftBukkit - Only send to players in range

Duplicate

Aikar

2013-02-16, 04:59 PM

2014-03-03, 09:55 AM

2013-12-15, 04:42 AM

0

2

Unconfirmed

Minecraft 1.4.7, Snapshot 13w10b, Minecraft 1.5

-