Paper/Spigot-Server-Patches/0486-Move-player-to-spawn-point-if-spawn-in-unloaded-worl.patch
Spottedleaf b4e629a283
Use distance map to optimise entity tracker / Misc Utils
Use the distance map to find candidate players for tracking.

This also ports a few utility changes from Tuinity
2020-05-06 03:47:24 -04:00

31 lines
1.4 KiB
Diff

From 9ac930771782d9f29527f7361b0435f5e357d2c6 Mon Sep 17 00:00:00 2001
From: 2277 <38501234+2277@users.noreply.github.com>
Date: Tue, 31 Mar 2020 10:33:55 +0100
Subject: [PATCH] Move player to spawn point if spawn in unloaded world
The code following this has better support for null worlds to move
them back to the world spawn.
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
index 01330045c0..9bb5a4bcf1 100644
--- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java
@@ -1790,9 +1790,11 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
bworld = server.getWorld(worldName);
}
- if (bworld == null) {
- bworld = ((org.bukkit.craftbukkit.CraftServer) server).getServer().getWorldServer(DimensionManager.OVERWORLD).getWorld();
- }
+ // Paper start - Move player to spawn point if spawn in unloaded world
+ // if (bworld == null) {
+ // bworld = ((org.bukkit.craftbukkit.CraftServer) server).getServer().getWorldServer(DimensionManager.OVERWORLD).getWorld();
+ // }
+ // Paper end
spawnIn(bworld == null ? null : ((CraftWorld) bworld).getHandle());
}
--
2.26.0