2020-06-26 01:38:24 +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
|
|
|
|
Subject: [PATCH] Do less work if we have a custom Bukkit generator
|
|
|
|
|
|
|
|
If the Bukkit generator already has a spawn, use it immediately instead
|
|
|
|
of spending time generating one that we won't use
|
|
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
2021-02-16 18:08:29 +01:00
|
|
|
index 04a149a4902790c6b6d3c54a1738fb0cf2d462f9..410e63e4d15fa6ba85683694444cd49c53446574 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
|
2020-08-25 04:22:08 +02:00
|
|
|
@@ -509,12 +509,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
2020-06-26 01:38:24 +02:00
|
|
|
} else if (flag1) {
|
2020-08-25 04:22:08 +02:00
|
|
|
iworlddataserver.setSpawn(BlockPosition.ZERO.up(), 0.0F);
|
2020-06-26 01:38:24 +02:00
|
|
|
} else {
|
|
|
|
- WorldChunkManager worldchunkmanager = chunkgenerator.getWorldChunkManager();
|
|
|
|
- Random random = new Random(worldserver.getSeed());
|
2020-08-25 04:22:08 +02:00
|
|
|
- BlockPosition blockposition = worldchunkmanager.a(0, worldserver.getSeaLevel(), 0, 256, (biomebase) -> {
|
|
|
|
- return biomebase.b().b();
|
|
|
|
- }, random);
|
2020-06-26 01:38:24 +02:00
|
|
|
- ChunkCoordIntPair chunkcoordintpair = blockposition == null ? new ChunkCoordIntPair(0, 0) : new ChunkCoordIntPair(blockposition);
|
|
|
|
+ // Paper start - moved down
|
|
|
|
// CraftBukkit start
|
|
|
|
if (worldserver.generator != null) {
|
|
|
|
Random rand = new Random(worldserver.getSeed());
|
2020-08-25 04:22:08 +02:00
|
|
|
@@ -530,6 +525,15 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
2020-06-26 01:38:24 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
// CraftBukkit end
|
|
|
|
+ // 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();
|
|
|
|
+ Random random = new Random(worldserver.getSeed());
|
2020-08-25 04:22:08 +02:00
|
|
|
+ BlockPosition blockposition = worldchunkmanager.a(0, worldserver.getSeaLevel(), 0, 256, (biomebase) -> {
|
|
|
|
+ return biomebase.b().b();
|
|
|
|
+ }, random);
|
2020-06-26 01:38:24 +02:00
|
|
|
+ ChunkCoordIntPair chunkcoordintpair = blockposition == null ? new ChunkCoordIntPair(0, 0) : new ChunkCoordIntPair(blockposition);
|
|
|
|
+ // Paper end
|
|
|
|
|
|
|
|
if (blockposition == null) {
|
|
|
|
MinecraftServer.LOGGER.warn("Unable to find spawn biome");
|