Paper/Spigot-Server-Patches/0407-Do-less-work-if-we-have-a-custom-Bukkit-generator.patch
Spottedleaf df984898ac Fix server deadlock when loading some chunks (#2647)
Upstream has released updates that appears to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing

CraftBukkit Changes:
7554e08e Add UUID support to CraftProfileBanList
3fe37460 SPIGOT-5378: Fix TileEntity fixer deadlock
12386dd4 SPIGOT-5375: Add spaces to coordinates from tile fixer
606c19e2 SPIGOT-5373: Simultaneous left+right click in creative mode does not work
13caf848 SPIGOT-5370: Fix Block#rayTrace considering other blocks.
2019-10-20 10:03:39 +01:00

44 lines
2.2 KiB
Diff

From d4d1dd1858ad3f51cd07eaac1ff5d799d50b1b79 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/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
index 5df9b0ffda..1330956655 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -698,12 +698,6 @@ public class WorldServer extends World {
} 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());
@@ -720,6 +714,14 @@ public class WorldServer extends World {
}
// 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");
}
--
2.22.1