mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-17 21:33:49 -07:00
[ci skip] rebuild patches
This commit is contained in:
@@ -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
|
||||
*
|
||||
|
Reference in New Issue
Block a user