Paper/patches/server/0766-Use-correct-LevelStem-registry-when-loading-default-.patch
Shane Freeder cfa5b37fa8
Updated Upstream (CraftBukkit)
Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing

CraftBukkit Changes:
03b725233 SPIGOT-6823: Fix loading custom world in combination with superflat
359d0533a #970: Correct typo in README.md
110492932 Fix per-world worldborder command
2021-12-03 00:26:54 +00:00

28 lines
1.5 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Jason Penilla <11360596+jpenilla@users.noreply.github.com>
Date: Sat, 16 Oct 2021 17:38:35 -0700
Subject: [PATCH] Use correct LevelStem registry when loading default
end/nether
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index c245c1f4611f7273c8da629f774e0c64e9f98fc2..481a5dbad82f3f8dd5b1bf8ab207d82ec73d5bbd 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -635,7 +635,14 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
long i = generatorsettings.seed();
long j = BiomeManager.obfuscateSeed(i);
List<CustomSpawner> list = ImmutableList.of(new PhantomSpawner(), new PatrolSpawner(), new CatSpawner(), new VillageSiege(), new WanderingTraderSpawner(iworlddataserver));
- LevelStem worlddimension = (LevelStem) registrymaterials.get(dimensionKey);
+ // Paper start - Use correct LevelStem registry
+ final LevelStem worlddimension;
+ if (dimensionKey == LevelStem.END || dimensionKey == LevelStem.NETHER) {
+ worlddimension = generatorsettings.dimensions().get(dimensionKey);
+ } else {
+ worlddimension = registrymaterials.get(dimensionKey);
+ }
+ // Paper end
DimensionType dimensionmanager;
ChunkGenerator chunkgenerator;