aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0405-Move-player-to-spawn-point-if-spawn-in-unloaded-worl.patch
diff options
context:
space:
mode:
authorJake Potrebic <[email protected]>2022-02-28 18:44:07 -0800
committerJason Penilla <[email protected]>2022-02-28 22:52:39 -0700
commit3526f22211b7d41e9bcda180664ef5dd7b6e22fe (patch)
tree4836e6cb1f34f8c59fc89f99cea4a2b835b5215f /patches/server/0405-Move-player-to-spawn-point-if-spawn-in-unloaded-worl.patch
parentfbe43d6a1dd7ac2b4ce03e1dccc088b5ae769b18 (diff)
downloadPaper-3526f22211b7d41e9bcda180664ef5dd7b6e22fe.tar.gz
Paper-3526f22211b7d41e9bcda180664ef5dd7b6e22fe.zip
move patch relying on TraceUtil to after its creation
Diffstat (limited to 'patches/server/0405-Move-player-to-spawn-point-if-spawn-in-unloaded-worl.patch')
-rw-r--r--patches/server/0405-Move-player-to-spawn-point-if-spawn-in-unloaded-worl.patch27
1 files changed, 27 insertions, 0 deletions
diff --git a/patches/server/0405-Move-player-to-spawn-point-if-spawn-in-unloaded-worl.patch b/patches/server/0405-Move-player-to-spawn-point-if-spawn-in-unloaded-worl.patch
new file mode 100644
index 0000000000..50edad1be1
--- /dev/null
+++ b/patches/server/0405-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 03ead8423d022f91f849990b6167d86fec066361..21cbab2bd5754158ae4aa1a95f8c80b685ec166b 100644
+--- a/src/main/java/net/minecraft/world/entity/Entity.java
++++ b/src/main/java/net/minecraft/world/entity/Entity.java
+@@ -2017,9 +2017,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());
+ }