[SPIGOT-7237] Spigot not informing structure generation plugins that unvisited --forceUpgraded chunks already exist, causing structure generation in existing chunks. Created: 18/Jan/23  Updated: 25/Dec/24

Status: Open
Project: Spigot
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Minor
Reporter: nou Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: -forceUpgrade, BetterStructures, Spigot, plugin, world
Environment:

Debian 10 buster, kernel 4.19.0-21-amd64

openjdk version "17.0.2" 2022-01-18
OpenJDK Runtime Environment Temurin-17.0.2+8 (build 17.0.2+8)
OpenJDK 64-Bit Server VM Temurin-17.0.2+8 (build 17.0.2+8, mixed mode, sharing)

Happens in both the latest Spigot as built by BuildTools in the version above, and Paper 1.19.0 #77 and 1.19.3 #379 (latest).


Attachments: File BetterStructures.jar     File OhTheDungeonsYoullGo-19_Grain_in_Ear_P1.jar     GIF File otd1.gif     GIF File otd2.gif    
Issue Links:
Relates
relates to SPIGOT-6915 ChunkPopulateEvent fires with non-new... Open
Version: This server is running CraftBukkit version 3638-Spigot-d90018e-7dcb59b (MC: 1.19.3) (Implementing API version 1.19.3-R0.1-SNAPSHOT)
Plugin: BetterStructures 1.3.5
Guidelines Read: Yes

 Description   

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.



 Comments   
Comment by nou [ 21/Jan/23 ]

Well, that answers that then. The MC wiki's description of forceUpgrade could be clearer. My misunderstanding of what it does wouldn't matter on earlier versions with no terrain modification because the end result of what it actually does versus what I thought it does would look the same. Thank you both. Feel free to close this.

Comment by md_5 [ 20/Jan/23 ]

forceUpgrade doesn't do terrain generation, it simply updates the data format

Comment by nou [ 18/Jan/23 ]

Please forgive my ignorance, but is that not what --forceUpgrade is meant to do in one shot? Why would a player visiting it in person flag it as generated, but --forceUpgrade doesn't after explicitly upgrading every chunk?

Thank you!

Comment by Black Hole [ 18/Jan/23 ]

While upgrading chunk that predates 1.18, Minecraft sets the chunk status back on those chunks, so that the chunk generator could fill the lower chunk sections.

See also: SPIGOT-6915

Generated at Sat Apr 05 10:22:53 UTC 2025 using Jira 10.3.3#10030003-sha1:d220e3fefc8dfc6d47f522d3b9a20c1455e12b7b.