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

Spigot not informing structure generation plugins that unvisited --forceUpgraded chunks already exist, causing structure generation in existing chunks.


    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None
    • None
    • This server is running CraftBukkit version 3638-Spigot-d90018e-7dcb59b (MC: 1.19.3) (Implementing API version 1.19.3-R0.1-SNAPSHOT)
    • BetterStructures 1.3.5
    • Yes

      The plugin BetterStructures is generating its custom structures in existing chunks that were -forceUpgraded to 1.19.x from versions anywhere between 1.13.x and 1.18.x, and have not already been visited by a player in 1.19.x yet. Old 1.18.x and earlier chunks that were visited by a player in 1.19.x prior to BS's installation do not generate BS structures. Newly generated 1.19.x chunks that predates BS's installation also do not generate BS structures.

      The server normally runs Paper, which is where this issue was first encountered, but I was able to reproduce the issue in Spigot with only the BetterStructures and FastAsyncWorldEdit plugins present (BS depends on FAWE for its structure pasting).

      Steps to reproduce are as follows:

      1: Set up virgin Spigot server with startup script specifying --forceUpgrade, run it once to generate files, then shut it down and delete the world folders.
      2: Copy in an old world (doesn't need to be very large, maybe 1000x1000 to be safe) from 1.16.x (or some other old version, the backup I'm using has chunks anywhere from 1.13.x to 1.16.x).
      3: Install FastAsyncWorldEdit and BetterStructures.
      4: Start server for the first time and let Spigot perform the world upgrade.
      5: Add yourself as an op in the console before joining to receive the BS generation messages.
      6: Join the server.
      7: Fly around areas of existing terrain and wait for BS to pop up alerts for new structures (usually happens near immediately), which you can then teleport to to confirm they generated in existing chunks.

      I also --forceUpgraded the world in a Vanilla 1.19.3 server freshly downloaded from Mojang, then copied the world into Spigot, loaded it normally, and BS structures still generated.

      I spoke to the BetterStructures dev (MagmaGuy) who advised the following, verbatim: "betterstructures uses the spigot api to determine if the chunks are new, thus if your update method for a map breaks spigot's detection of new chunks it will also make betterstructures unable to determine if the chunks are new"

      Another plugin, OhTheDungeonsYou'llGo, exhibits the same problem with its dungeon generation, however this plugin recently went defunct, it's dev is gone, and it doesn't generate chat notifications when a new dungeon generates. But we have seen its dungeons appear in existing terrain on the server's dynmap. It's easier to test with BetterStructures, but they both have the same problem. Attached are two GIFs before and after OTD dungeons entrances that generated in old chunks.

      I don't know if this issue is the world chunks losing whatever tag marks them as generated during the --forceUpgrade process, or if the Spigot API can't understand --forceUpgrade's marking of the chunk as not new, or just isn't providing that information to BetterStructures or OTD when they request it.

      I am unable to provide a minimal reproduction plugin as I am no developer, but BS is pretty simple by itself and the behavior manifests with its default config. I included OTD for completion as well.

        1. BetterStructures.jar
          2.81 MB
        2. OhTheDungeonsYoullGo-19_Grain_in_Ear_P1.jar
          5.82 MB
        3. otd1.gif
          283 kB
        4. otd2.gif
          141 kB

            Unassigned Unassigned
            SaladKing nou
            0 Vote for this issue
            3 Start watching this issue