Skip to content

Commit 944ce44

Browse files
committed
Fix CraftWorld identifier passing
1 parent 6fe7eb5 commit 944ce44

2 files changed

Lines changed: 8 additions & 10 deletions

File tree

paper-server/patches/sources/net/minecraft/world/level/Level.java.patch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@
9090
+ this.spigotConfig = new org.spigotmc.SpigotWorldConfig(bukkitName, CraftNamespacedKey.fromMinecraft(dimension.identifier())); // Spigot
9191
+ this.paperConfig = paperWorldConfigCreator.apply(this.spigotConfig); // Paper - create paper world config
9292
+ this.generator = generator;
93-
+ this.world = new CraftWorld((ServerLevel) this, generator, biomeProvider, environment);
93+
+ this.world = new CraftWorld((ServerLevel) this, dimension.identifier(), biomeProvider, environment);
9494
+
9595
+ for (SpawnCategory spawnCategory : SpawnCategory.values()) {
9696
+ if (org.bukkit.craftbukkit.util.CraftSpawnCategory.isValidForLimits(spawnCategory)) {

paper-server/src/main/java/org/bukkit/craftbukkit/CraftWorld.java

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -170,21 +170,20 @@ public class CraftWorld extends CraftRegionAccessor implements World {
170170
.resolving(net.kyori.adventure.identity.Identity.UUID, World::getUID)
171171
.build();
172172

173-
private final ServerLevel world;
174-
private WorldBorder worldBorder;
175-
private Environment environment;
176173
private final CraftServer server = (CraftServer) Bukkit.getServer();
177-
private final @Nullable ChunkGenerator generator;
178174
private final @Nullable BiomeProvider biomeProvider;
179175
private final List<BlockPopulator> populators = new ArrayList<>();
180176
private final BlockMetadataStore blockMetadata = new BlockMetadataStore(this);
181177
private final Object2IntOpenHashMap<SpawnCategory> spawnCategoryLimit = new Object2IntOpenHashMap<>();
182178
private final CraftPersistentDataContainer persistentDataContainer = new CraftPersistentDataContainer(CraftWorld.DATA_TYPE_REGISTRY);
179+
private final ServerLevel world;
180+
private final NamespacedKey key;
181+
private final Environment environment;
182+
private WorldBorder worldBorder;
183183
// Paper start - void damage configuration
184184
private boolean voidDamageEnabled;
185185
private float voidDamageAmount;
186186
private double voidDamageMinBuildHeightOffset;
187-
private final NamespacedKey key;
188187

189188
@Override
190189
public boolean isVoidDamageEnabled() {
@@ -297,10 +296,9 @@ public boolean hasStructureAt(final io.papermc.paper.math.Position position, fin
297296

298297
private static final Random rand = new Random();
299298

300-
public CraftWorld(ServerLevel world, @Nullable ChunkGenerator generator, @Nullable BiomeProvider biomeProvider, Environment environment) {
299+
public CraftWorld(ServerLevel world, Identifier identifier, @Nullable BiomeProvider biomeProvider, Environment environment) {
301300
this.world = world;
302-
this.key = CraftNamespacedKey.fromMinecraft(this.world.dimension().identifier());
303-
this.generator = generator;
301+
this.key = CraftNamespacedKey.fromMinecraft(identifier);
304302
this.biomeProvider = biomeProvider;
305303

306304
this.environment = environment;
@@ -875,7 +873,7 @@ public boolean createExplosion(Location loc, float power, boolean setFire, boole
875873

876874
@Override
877875
public @Nullable ChunkGenerator getGenerator() {
878-
return this.generator;
876+
return this.world.generator;
879877
}
880878

881879
@Override

0 commit comments

Comments
 (0)