SPIGOT-6802: Fix major issues with --forceUpgrade

More to come

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot
2021-11-23 17:13:52 +11:00
parent 90f6dfa935
commit 820ad30036
6 changed files with 46 additions and 54 deletions

View File

@@ -5,7 +5,7 @@
import net.minecraft.world.level.storage.WorldPersistentData;
+// CraftBukkit start
+import net.minecraft.world.level.dimension.DimensionManager;
+import net.minecraft.world.level.dimension.WorldDimension;
+// CraftBukkit end
+
public class PersistentStructureLegacy {
@@ -17,18 +17,18 @@
- public static PersistentStructureLegacy getLegacyStructureHandler(ResourceKey<World> resourcekey, @Nullable WorldPersistentData worldpersistentdata) {
- if (resourcekey == World.OVERWORLD) {
+ public static PersistentStructureLegacy getLegacyStructureHandler(ResourceKey<DimensionManager> resourcekey, @Nullable WorldPersistentData worldpersistentdata) { // CraftBukkit
+ if (resourcekey == DimensionManager.OVERWORLD_LOCATION) { // CraftBukkit
+ public static PersistentStructureLegacy getLegacyStructureHandler(ResourceKey<WorldDimension> resourcekey, @Nullable WorldPersistentData worldpersistentdata) { // CraftBukkit
+ if (resourcekey == WorldDimension.OVERWORLD) { // CraftBukkit
return new PersistentStructureLegacy(worldpersistentdata, ImmutableList.of("Monument", "Stronghold", "Village", "Mineshaft", "Temple", "Mansion"), ImmutableList.of("Village", "Mineshaft", "Mansion", "Igloo", "Desert_Pyramid", "Jungle_Pyramid", "Swamp_Hut", "Stronghold", "Monument"));
} else {
ImmutableList immutablelist;
- if (resourcekey == World.NETHER) {
+ if (resourcekey == DimensionManager.NETHER_LOCATION) { // CraftBukkit
+ if (resourcekey == WorldDimension.NETHER) { // CraftBukkit
immutablelist = ImmutableList.of("Fortress");
return new PersistentStructureLegacy(worldpersistentdata, immutablelist, immutablelist);
- } else if (resourcekey == World.END) {
+ } else if (resourcekey == DimensionManager.END_LOCATION) { // CraftBukkit
+ } else if (resourcekey == WorldDimension.END) { // CraftBukkit
immutablelist = ImmutableList.of("EndCity");
return new PersistentStructureLegacy(worldpersistentdata, immutablelist, immutablelist);
} else {