From 68a7b9fec80e39788fccf19ebd1e00aad18b16e5 Mon Sep 17 00:00:00 2001 From: 2277 <38501234+2277@users.noreply.github.com> Date: Tue, 31 Mar 2020 10:38:18 +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. --- ...pawn-point-if-spawn-in-unloaded-worl.patch | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 Spigot-Server-Patches/0488-Move-player-to-spawn-point-if-spawn-in-unloaded-worl.patch diff --git a/Spigot-Server-Patches/0488-Move-player-to-spawn-point-if-spawn-in-unloaded-worl.patch b/Spigot-Server-Patches/0488-Move-player-to-spawn-point-if-spawn-in-unloaded-worl.patch new file mode 100644 index 000000000..97fb41107 --- /dev/null +++ b/Spigot-Server-Patches/0488-Move-player-to-spawn-point-if-spawn-in-unloaded-worl.patch @@ -0,0 +1,30 @@ +From 3d7bdaea0c45ee77416c305159643fc4b397dfee 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 96a47dd1c2..46e631d466 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.25.1 +