2019-09-29 22:02:04 +02:00
|
|
|
From ad2c4f712acd7b7bd10e4dae9181cd3edf98b9ca Mon Sep 17 00:00:00 2001
|
2019-08-11 18:23:11 +02:00
|
|
|
From: Paul Sauve <paul@burngames.net>
|
|
|
|
Date: Sun, 14 Jul 2019 21:05:03 -0500
|
2019-08-11 18:27:09 +02:00
|
|
|
Subject: [PATCH] Do less work if we have a custom Bukkit generator
|
2019-08-11 18:23:11 +02:00
|
|
|
|
2019-08-11 18:27:09 +02: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 18:23:11 +02:00
|
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
|
2019-09-29 22:02:04 +02:00
|
|
|
index 6220af6b4..f1ad7be75 100644
|
2019-08-11 18:23:11 +02:00
|
|
|
--- a/src/main/java/net/minecraft/server/WorldServer.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/WorldServer.java
|
2019-08-11 18:27:09 +02:00
|
|
|
@@ -663,12 +663,6 @@ public class WorldServer extends World {
|
2019-08-11 18:23:11 +02:00
|
|
|
} else if (this.worldData.getType() == WorldType.DEBUG_ALL_BLOCK_STATES) {
|
|
|
|
this.worldData.setSpawn(BlockPosition.ZERO.up());
|
|
|
|
} else {
|
|
|
|
- WorldChunkManager worldchunkmanager = this.chunkProvider.getChunkGenerator().getWorldChunkManager();
|
|
|
|
- List<BiomeBase> list = worldchunkmanager.a();
|
|
|
|
- Random random = new Random(this.getSeed());
|
|
|
|
- BlockPosition blockposition = worldchunkmanager.a(0, 0, 256, list, random);
|
|
|
|
- ChunkCoordIntPair chunkcoordintpair = blockposition == null ? new ChunkCoordIntPair(0, 0) : new ChunkCoordIntPair(blockposition);
|
|
|
|
-
|
|
|
|
// CraftBukkit start
|
|
|
|
if (this.generator != null) {
|
|
|
|
Random rand = new Random(this.getSeed());
|
2019-08-11 18:27:09 +02:00
|
|
|
@@ -685,6 +679,14 @@ public class WorldServer extends World {
|
2019-08-11 18:23:11 +02:00
|
|
|
}
|
|
|
|
// CraftBukkit end
|
|
|
|
|
|
|
|
+ // Paper start - this is useless if craftbukkit returns early
|
|
|
|
+ WorldChunkManager worldchunkmanager = this.chunkProvider.getChunkGenerator().getWorldChunkManager();
|
|
|
|
+ List<BiomeBase> list = worldchunkmanager.a();
|
|
|
|
+ Random random = new Random(this.getSeed());
|
|
|
|
+ BlockPosition blockposition = worldchunkmanager.a(0, 0, 256, list, random);
|
|
|
|
+ ChunkCoordIntPair chunkcoordintpair = blockposition == null ? new ChunkCoordIntPair(0, 0) : new ChunkCoordIntPair(blockposition);
|
|
|
|
+ // Paper end
|
|
|
|
+
|
|
|
|
if (blockposition == null) {
|
|
|
|
WorldServer.LOGGER.warn("Unable to find spawn biome");
|
|
|
|
}
|
|
|
|
--
|
2019-08-21 03:02:51 +02:00
|
|
|
2.23.0
|
2019-08-11 18:23:11 +02:00
|
|
|
|