diff options
Diffstat (limited to 'patches/server/0408-Move-player-to-spawn-point-if-spawn-in-unloaded-worl.patch')
-rw-r--r-- | patches/server/0408-Move-player-to-spawn-point-if-spawn-in-unloaded-worl.patch | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/patches/server/0408-Move-player-to-spawn-point-if-spawn-in-unloaded-worl.patch b/patches/server/0408-Move-player-to-spawn-point-if-spawn-in-unloaded-worl.patch new file mode 100644 index 0000000000..79510cd186 --- /dev/null +++ b/patches/server/0408-Move-player-to-spawn-point-if-spawn-in-unloaded-worl.patch @@ -0,0 +1,27 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: 2277 <[email protected]> +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/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java +index a3a80ad047dfa9ba1c058eaaf95b76cd3e0ec490..3ef63d278464d4b4ebd5bd1b69b68bf0c818b9ab 100644 +--- a/src/main/java/net/minecraft/world/entity/Entity.java ++++ b/src/main/java/net/minecraft/world/entity/Entity.java +@@ -1998,9 +1998,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, i + bworld = server.getWorld(worldName); + } + +- if (bworld == null) { +- bworld = ((org.bukkit.craftbukkit.CraftServer) server).getServer().getLevel(Level.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(World.OVERWORLD).getWorld(); ++// } ++ // Paper end - Move player to spawn point if spawn in unloaded world + + ((ServerPlayer) this).setLevel(bworld == null ? null : ((CraftWorld) bworld).getHandle()); + } |