2020-04-02 21:07:06 +00:00
|
|
|
From 7656819871f3bf85bbabcd0dc304de0a9395c5f2 Mon Sep 17 00:00:00 2001
|
2019-08-11 16:23:11 +00:00
|
|
|
From: Paul Sauve <paul@burngames.net>
|
|
|
|
Date: Sun, 14 Jul 2019 21:05:03 -0500
|
2019-08-11 16:27:09 +00:00
|
|
|
Subject: [PATCH] Do less work if we have a custom Bukkit generator
|
2019-08-11 16:23:11 +00:00
|
|
|
|
2019-08-11 16:27:09 +00:00
|
|
|
If the Bukkit generator already has a spawn, use it immediately instead
|
|
|
|
of spending time generating one that we won't use
|
2019-08-11 16:23:11 +00:00
|
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
|
2020-04-02 21:07:06 +00:00
|
|
|
index 7088dbf6a2..08e9444fad 100644
|
2019-08-11 16:23:11 +00:00
|
|
|
--- a/src/main/java/net/minecraft/server/WorldServer.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/WorldServer.java
|
2020-03-19 06:03:32 +00:00
|
|
|
@@ -811,12 +811,13 @@ public class WorldServer extends World {
|
2019-08-11 16:23:11 +00:00
|
|
|
} else if (this.worldData.getType() == WorldType.DEBUG_ALL_BLOCK_STATES) {
|
|
|
|
this.worldData.setSpawn(BlockPosition.ZERO.up());
|
|
|
|
} else {
|
2019-12-12 16:20:43 +00:00
|
|
|
- WorldChunkManager worldchunkmanager = this.getChunkProvider().getChunkGenerator().getWorldChunkManager();
|
2019-08-11 16:23:11 +00:00
|
|
|
- List<BiomeBase> list = worldchunkmanager.a();
|
|
|
|
- Random random = new Random(this.getSeed());
|
2019-12-12 16:20:43 +00:00
|
|
|
- BlockPosition blockposition = worldchunkmanager.a(0, this.getSeaLevel(), 0, 256, list, random);
|
2019-08-11 16:23:11 +00:00
|
|
|
- ChunkCoordIntPair chunkcoordintpair = blockposition == null ? new ChunkCoordIntPair(0, 0) : new ChunkCoordIntPair(blockposition);
|
|
|
|
-
|
2019-12-12 16:20:43 +00:00
|
|
|
+// Paper start - moved down
|
|
|
|
+// WorldChunkManager worldchunkmanager = this.getChunkProvider().getChunkGenerator().getWorldChunkManager();
|
|
|
|
+// List<BiomeBase> list = worldchunkmanager.a();
|
|
|
|
+// Random random = new Random(this.getSeed());
|
|
|
|
+// BlockPosition blockposition = worldchunkmanager.a(0, this.getSeaLevel(), 0, 256, list, random);
|
|
|
|
+// ChunkCoordIntPair chunkcoordintpair = blockposition == null ? new ChunkCoordIntPair(0, 0) : new ChunkCoordIntPair(blockposition);
|
|
|
|
+// Paper end
|
2019-08-11 16:23:11 +00:00
|
|
|
// CraftBukkit start
|
|
|
|
if (this.generator != null) {
|
|
|
|
Random rand = new Random(this.getSeed());
|
2020-03-19 06:03:32 +00:00
|
|
|
@@ -833,6 +834,13 @@ public class WorldServer extends World {
|
2019-08-11 16:23:11 +00:00
|
|
|
}
|
|
|
|
// CraftBukkit end
|
|
|
|
|
|
|
|
+ // Paper start - this is useless if craftbukkit returns early
|
2019-12-13 01:18:18 +00:00
|
|
|
+ WorldChunkManager worldchunkmanager = this.getChunkProvider().getChunkGenerator().getWorldChunkManager();
|
2019-08-11 16:23:11 +00:00
|
|
|
+ List<BiomeBase> list = worldchunkmanager.a();
|
|
|
|
+ Random random = new Random(this.getSeed());
|
2019-12-12 16:20:43 +00:00
|
|
|
+ BlockPosition blockposition = worldchunkmanager.a(0, this.getSeaLevel(), 0, 256, list, random);
|
2019-08-11 16:23:11 +00:00
|
|
|
+ ChunkCoordIntPair chunkcoordintpair = blockposition == null ? new ChunkCoordIntPair(0, 0) : new ChunkCoordIntPair(blockposition);
|
|
|
|
+ // Paper end
|
|
|
|
if (blockposition == null) {
|
|
|
|
WorldServer.LOGGER.warn("Unable to find spawn biome");
|
|
|
|
}
|
|
|
|
--
|
2020-04-02 21:07:06 +00:00
|
|
|
2.25.1
|
2019-08-11 16:23:11 +00:00
|
|
|
|