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

isChunkGenerated creates empty region files

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • None
    • None
    • Windows 10 Education Edition

       

    • This server is running CraftBukkit version git-Spigot-e7dc2f5-ce66f69 (MC: 1.15.2) (Implementing API version 1.15.2-R0.1-SNAPSHOT)
    • Yes

      I have some code that finds chests in a pre-generated map. To locate the chests, the program first creates a list of all the existing chunks by calling World#isChunkGenerated in a loop, and storing the coordinates of the chunk in an array if it returns true. Since the map size isn't known ahead of time, the loop iterates over a large chunk area (chunk coords -400, -400 to 400, 400).

      However, it seems that this process generates empty region (.mca) files for chunks that don't already exist. Stepping through with the debugger, it's evident the creation of these files occurs when World#isChunkGenerated is called. This seems like unintended behaviour.

      Attached is a minimal plugin to demonstrate this and a screenshot of the pertinent loop.

       

      To reproduce:

      1. place the plugin in your /plugins directory,
      2. generate a new world,
      3. open the world/region folder so you can see it, then
      4. call the command /ischunkgeneratedbug.

      In the region folder, hundreds of new 0kb or 8kb .mca files will be created. On stop, these files aren't removed.

       

      If any more information is needed, please let me know. Thanks!

            Unassigned Unassigned
            henges aj
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: