2019-08-11 18:23:11 +02:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
|
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
|
|
|
|
2020-06-26 01:38:24 +02:00
|
|
|
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
2020-05-06 11:48:49 +02:00
|
|
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
2020-06-26 01:38:24 +02:00
|
|
|
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
|
|
|
@@ -0,0 +0,0 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
|
|
|
} else if (flag1) {
|
|
|
|
iworlddataserver.setSpawn(BlockPosition.ZERO.up());
|
2019-08-11 18:23:11 +02:00
|
|
|
} else {
|
2020-06-26 01:38:24 +02:00
|
|
|
- WorldChunkManager worldchunkmanager = chunkgenerator.getWorldChunkManager();
|
|
|
|
- List<BiomeBase> list = worldchunkmanager.b();
|
|
|
|
- Random random = new Random(worldserver.getSeed());
|
|
|
|
- BlockPosition blockposition = worldchunkmanager.a(0, worldserver.getSeaLevel(), 0, 256, list, random);
|
2019-08-11 18:23:11 +02:00
|
|
|
- ChunkCoordIntPair chunkcoordintpair = blockposition == null ? new ChunkCoordIntPair(0, 0) : new ChunkCoordIntPair(blockposition);
|
2020-06-26 01:38:24 +02:00
|
|
|
+ // Paper start - moved down
|
2019-08-11 18:23:11 +02:00
|
|
|
// CraftBukkit start
|
2020-06-26 01:38:24 +02:00
|
|
|
if (worldserver.generator != null) {
|
|
|
|
Random rand = new Random(worldserver.getSeed());
|
|
|
|
@@ -0,0 +0,0 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
|
|
|
}
|
2019-08-11 18:23:11 +02:00
|
|
|
}
|
|
|
|
// CraftBukkit end
|
2020-06-26 01:38:24 +02:00
|
|
|
+ // Paper start - if the generator created a spawn for us, then there is no need for us to also create a spawn -
|
|
|
|
+ // only do it if the generator did not
|
|
|
|
+ WorldChunkManager worldchunkmanager = chunkgenerator.getWorldChunkManager();
|
|
|
|
+ List<BiomeBase> list = worldchunkmanager.b();
|
|
|
|
+ Random random = new Random(worldserver.getSeed());
|
|
|
|
+ BlockPosition blockposition = worldchunkmanager.a(0, worldserver.getSeaLevel(), 0, 256, list, random);
|
2019-08-11 18:23:11 +02:00
|
|
|
+ ChunkCoordIntPair chunkcoordintpair = blockposition == null ? new ChunkCoordIntPair(0, 0) : new ChunkCoordIntPair(blockposition);
|
|
|
|
+ // Paper end
|
2020-06-26 01:38:24 +02:00
|
|
|
|
2019-08-11 18:23:11 +02:00
|
|
|
if (blockposition == null) {
|
2020-06-26 01:38:24 +02:00
|
|
|
MinecraftServer.LOGGER.warn("Unable to find spawn biome");
|