2021-06-11 12:02:28 +00:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
2021-11-27 08:11:43 +00:00
|
|
|
From: MiniDigger <admin@benndorf.dev>
|
2021-06-11 12:02:28 +00:00
|
|
|
Date: Wed, 29 Apr 2020 02:09:17 +0200
|
|
|
|
Subject: [PATCH] Allow delegation to vanilla chunk gen
|
|
|
|
|
|
|
|
|
|
|
|
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
|
2022-06-07 17:03:07 +00:00
|
|
|
index 3e3e48f467eef561eeada98c6b99388e23595d7f..32d346fb12c976253a3731df6613983f01a9ebb5 100644
|
2021-06-11 12:02:28 +00:00
|
|
|
--- a/src/main/java/org/bukkit/Bukkit.java
|
|
|
|
+++ b/src/main/java/org/bukkit/Bukkit.java
|
2022-05-06 12:21:58 +00:00
|
|
|
@@ -1861,6 +1861,24 @@ public final class Bukkit {
|
2021-06-11 12:02:28 +00:00
|
|
|
return server.createChunkData(world);
|
|
|
|
}
|
2021-12-05 10:27:20 +00:00
|
|
|
|
2021-06-11 12:02:28 +00:00
|
|
|
+ // Paper start
|
|
|
|
+ /**
|
|
|
|
+ * Create a ChunkData for use in a generator, that is populated by the vanilla generator for that world
|
|
|
|
+ *
|
|
|
|
+ * @param world the world to create the ChunkData for
|
|
|
|
+ * @param x the x coordinate of the chunk
|
|
|
|
+ * @param z the z coordinate of the chunk
|
|
|
|
+ * @return a new ChunkData for the world
|
2021-12-05 10:27:20 +00:00
|
|
|
+ * @deprecated The new multi-stage worldgen API allows a similar effect by overriding all of the "shouldGenerate..." methods to
|
|
|
|
+ * return true, and then modifying the chunkdata in a later stage such as surface or bedrock generation.
|
2021-06-11 12:02:28 +00:00
|
|
|
+ */
|
|
|
|
+ @NotNull
|
2021-12-05 10:27:20 +00:00
|
|
|
+ @Deprecated(forRemoval = true)
|
2021-06-11 12:02:28 +00:00
|
|
|
+ public static ChunkGenerator.ChunkData createVanillaChunkData(@NotNull World world, int x, int z) {
|
|
|
|
+ return server.createVanillaChunkData(world, x, z);
|
|
|
|
+ }
|
|
|
|
+ // Paper stop
|
|
|
|
+
|
|
|
|
/**
|
|
|
|
* Creates a boss bar instance to display to players. The progress
|
|
|
|
* defaults to 1.0
|
|
|
|
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
|
2022-05-20 16:57:07 +00:00
|
|
|
index 2409c0023f90689399c8ceba179b800156d16eea..64e4667efbf60204076ef32d64aa3a76c399df05 100644
|
2021-06-11 12:02:28 +00:00
|
|
|
--- a/src/main/java/org/bukkit/Server.java
|
|
|
|
+++ b/src/main/java/org/bukkit/Server.java
|
2022-05-20 16:57:07 +00:00
|
|
|
@@ -1564,6 +1564,22 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
|
2021-06-11 12:02:28 +00:00
|
|
|
@NotNull
|
|
|
|
public ChunkGenerator.ChunkData createChunkData(@NotNull World world);
|
2021-12-05 10:27:20 +00:00
|
|
|
|
2021-06-11 12:02:28 +00:00
|
|
|
+ // Paper start
|
|
|
|
+ /**
|
2021-12-05 10:27:20 +00:00
|
|
|
+ * Create a ChunkData for use in a generator, that is populated by the vanilla generator for that world.
|
2021-06-11 12:02:28 +00:00
|
|
|
+ *
|
|
|
|
+ * @param world the world to create the ChunkData for
|
|
|
|
+ * @param x the x coordinate of the chunk
|
|
|
|
+ * @param z the z coordinate of the chunk
|
|
|
|
+ * @return a new ChunkData for the world
|
2021-12-05 10:27:20 +00:00
|
|
|
+ * @deprecated The new multi-stage worldgen API allows a similar effect by overriding all of the "shouldGenerate..." methods to
|
|
|
|
+ * return true, and then modifying the chunkdata in a later stage such as surface or bedrock generation.
|
2021-06-11 12:02:28 +00:00
|
|
|
+ */
|
|
|
|
+ @NotNull
|
2021-12-05 10:27:20 +00:00
|
|
|
+ @Deprecated(forRemoval = true)
|
2021-06-11 12:02:28 +00:00
|
|
|
+ ChunkGenerator.ChunkData createVanillaChunkData(@NotNull World world, int x, int z);
|
|
|
|
+ // Paper end
|
|
|
|
+
|
|
|
|
/**
|
|
|
|
* Creates a boss bar instance to display to players. The progress
|
|
|
|
* defaults to 1.0
|
|
|
|
diff --git a/src/main/java/org/bukkit/generator/ChunkGenerator.java b/src/main/java/org/bukkit/generator/ChunkGenerator.java
|
2022-06-07 17:03:07 +00:00
|
|
|
index e70e6949a9d5a5a37f0c92e139071d4060548e96..ef756dcd55146af71649658eadc45b70d3ba057f 100644
|
2021-06-11 12:02:28 +00:00
|
|
|
--- a/src/main/java/org/bukkit/generator/ChunkGenerator.java
|
|
|
|
+++ b/src/main/java/org/bukkit/generator/ChunkGenerator.java
|
2021-08-25 07:59:26 +00:00
|
|
|
@@ -454,6 +454,22 @@ public abstract class ChunkGenerator {
|
2021-06-11 12:02:28 +00:00
|
|
|
return false;
|
|
|
|
}
|
2021-12-05 10:27:20 +00:00
|
|
|
|
2021-06-11 12:02:28 +00:00
|
|
|
+ // Paper start
|
|
|
|
+ /**
|
|
|
|
+ * Create a ChunkData for use in a generator, that is populated by the vanilla generator for that world
|
|
|
|
+ *
|
|
|
|
+ * @param world the world to create the ChunkData for
|
|
|
|
+ * @param x the x coordinate of the chunk
|
|
|
|
+ * @param z the z coordinate of the chunk
|
|
|
|
+ * @return a new ChunkData for the world
|
|
|
|
+ *
|
|
|
|
+ */
|
|
|
|
+ @NotNull
|
|
|
|
+ public ChunkData createVanillaChunkData(@NotNull World world, int x, int z) {
|
|
|
|
+ return Bukkit.getServer().createVanillaChunkData(world, x, z);
|
|
|
|
+ }
|
|
|
|
+ // Paper end
|
|
|
|
+
|
|
|
|
/**
|
|
|
|
* Data for a Chunk.
|
|
|
|
*/
|