Uploaded image for project: 'Minecraft: Java Edition'
  1. Minecraft: Java Edition
  2. MC-9886

Maps in item frames cause un-necessary lag

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • None
    • Minecraft 1.4.7, Snapshot 13w10b, Minecraft 1.5
    • None
    • Unconfirmed

      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
      

            Unassigned Unassigned
            aikar Aikar
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: