[ci skip] rebuild patches

This commit is contained in:
Jake Potrebic
2023-03-23 14:57:03 -07:00
parent 39255145b6
commit 0adc18baf8
60 changed files with 1113 additions and 1197 deletions

View File

@@ -110,14 +110,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
public WorldCreator(@NotNull String name) {
- if (name == null) {
- throw new IllegalArgumentException("World name cannot be null");
- }
-
- this.name = name;
- this.seed = (new Random()).nextLong();
+ // Paper start
+ this(name, getWorldKey(name));
}
+ }
+
+ private static NamespacedKey getWorldKey(String name) {
+ final String mainLevelName = Bukkit.getUnsafe().getMainLevelName();
+ if (name.equals(mainLevelName)) {
@@ -128,9 +124,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ return NamespacedKey.minecraft("the_end");
+ } else {
+ return NamespacedKey.minecraft(name.toLowerCase(java.util.Locale.ENGLISH).replace(" ", "_"));
+ }
}
+ }
+
- this.name = name;
+ /**
+ * Creates an empty WorldCreator for the given world name and key
+ *
@@ -142,7 +139,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ throw new IllegalArgumentException("World name and key cannot be null");
+ }
+ this.name = levelName;
+ this.seed = (new Random()).nextLong();
this.seed = (new Random()).nextLong();
+ this.key = worldKey;
+ }
+
@@ -186,9 +183,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ @NotNull
+ public static WorldCreator ofKey(@NotNull NamespacedKey worldKey) {
+ return new WorldCreator(worldKey);
+ }
}
+ // Paper end
+
/**
* Copies the options from the specified world
*