Uploaded image for project: 'Spigot'
  1. Spigot
  2. SPIGOT-2286

Spigot loads adjacent chunks when tile entities are queried on a loaded chunk

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • None
    • None
    • Spigot/latest version

      If a user calls getTileEntities() on a loaded chunk, it is unreasonable to expect this will cause adjacent chunks to load, however this is exactly what happens.

      getTileEntities() creates a new CraftBlockState for each CraftBlock. In the CraftBlockState constructor, getLightLevel() is called.
      getLightLevel() in the world class queries the light of the block based off of adjacent blocks.
      If the tile entity is on a chunk border this causes adjacent chunks to be synchronously loaded.

      This is definitely undesirable and can result in hundreds of extra chunks being loaded when any plugin does a wider entity query.

      (Like the essentials command /gc for example)

            Unassigned Unassigned
            wd40bomber7 A P
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: