Readd dropped hunk for ender dragon fight data (#11975)

Dragon fight data should be read from the now split world instead of the
main world level.dat.
Partial hunk was dropped during hardfork.
This commit is contained in:
Bjarne Koll
2025-01-14 19:03:30 +01:00
committed by GitHub
parent eeec611b9d
commit 209e5f8580

View File

@ -204,15 +204,17 @@
chunkGenerator, chunkGenerator,
this.chunkSource.randomState(), this.chunkSource.randomState(),
this, this,
@@ -281,7 +_,7 @@ @@ -281,8 +_,8 @@
fixerUpper fixerUpper
); );
this.structureManager = new StructureManager(this, server.getWorldData().worldGenOptions(), this.structureCheck); this.structureManager = new StructureManager(this, server.getWorldData().worldGenOptions(), this.structureCheck);
- if (this.dimension() == Level.END && this.dimensionTypeRegistration().is(BuiltinDimensionTypes.END)) { - if (this.dimension() == Level.END && this.dimensionTypeRegistration().is(BuiltinDimensionTypes.END)) {
- this.dragonFight = new EndDragonFight(this, seed, server.getWorldData().endDragonFightData());
+ if (this.dimension() == Level.END && this.dimensionTypeRegistration().is(BuiltinDimensionTypes.END) || env == org.bukkit.World.Environment.THE_END) { // CraftBukkit - Allow to create EnderDragonBattle in default and custom END + if (this.dimension() == Level.END && this.dimensionTypeRegistration().is(BuiltinDimensionTypes.END) || env == org.bukkit.World.Environment.THE_END) { // CraftBukkit - Allow to create EnderDragonBattle in default and custom END
this.dragonFight = new EndDragonFight(this, seed, server.getWorldData().endDragonFightData()); + this.dragonFight = new EndDragonFight(this, this.serverLevelData.worldGenOptions().seed(), this.serverLevelData.endDragonFightData()); // CraftBukkit
} else { } else {
this.dragonFight = null; this.dragonFight = null;
}
@@ -292,7 +_,15 @@ @@ -292,7 +_,15 @@
this.randomSequences = Objects.requireNonNullElseGet( this.randomSequences = Objects.requireNonNullElseGet(
randomSequences, () -> this.getDataStorage().computeIfAbsent(RandomSequences.factory(seed), "random_sequences") randomSequences, () -> this.getDataStorage().computeIfAbsent(RandomSequences.factory(seed), "random_sequences")