42 lines
2.4 KiB
Diff
42 lines
2.4 KiB
Diff
--- a/net/minecraft/world/level/levelgen/structure/PersistentStructureLegacy.java
|
|
+++ b/net/minecraft/world/level/levelgen/structure/PersistentStructureLegacy.java
|
|
@@ -23,6 +23,10 @@
|
|
import net.minecraft.world.level.World;
|
|
import net.minecraft.world.level.storage.WorldPersistentData;
|
|
|
|
+// CraftBukkit start
|
|
+import net.minecraft.world.level.dimension.WorldDimension;
|
|
+// CraftBukkit end
|
|
+
|
|
public class PersistentStructureLegacy {
|
|
|
|
private static final Map<String, String> CURRENT_TO_LEGACY_MAP = (Map) SystemUtils.make(Maps.newHashMap(), (hashmap) -> {
|
|
@@ -179,7 +183,7 @@
|
|
Optional<String> optional = nbttaglist.getCompound(0).flatMap((nbttagcompound2) -> {
|
|
return nbttagcompound2.getString("id");
|
|
});
|
|
- Map map = PersistentStructureLegacy.LEGACY_TO_CURRENT_MAP;
|
|
+ Map<String, String> map = PersistentStructureLegacy.LEGACY_TO_CURRENT_MAP; // CraftBukkit - decompile error
|
|
|
|
Objects.requireNonNull(map);
|
|
optional.map(map::get).ifPresent((s2) -> {
|
|
@@ -215,14 +219,14 @@
|
|
}
|
|
}
|
|
|
|
- public static PersistentStructureLegacy getLegacyStructureHandler(ResourceKey<World> resourcekey, @Nullable WorldPersistentData worldpersistentdata) {
|
|
- if (resourcekey == World.OVERWORLD) {
|
|
+ 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 if (resourcekey == World.NETHER) {
|
|
+ } else if (resourcekey == WorldDimension.NETHER) { // CraftBukkit
|
|
List<String> list = ImmutableList.of("Fortress");
|
|
|
|
return new PersistentStructureLegacy(worldpersistentdata, list, list);
|
|
- } else if (resourcekey == World.END) {
|
|
+ } else if (resourcekey == WorldDimension.END) { // CraftBukkit
|
|
List<String> list1 = ImmutableList.of("EndCity");
|
|
|
|
return new PersistentStructureLegacy(worldpersistentdata, list1, list1);
|