2020-05-06 11:48:49 +02:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
2020-03-31 11:38:18 +02:00
|
|
|
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
|
2020-09-11 01:47:58 +02:00
|
|
|
index 5616234c2efee61316b8ad051f4cf5ce4e63448f..61633d5be6d16546b0780da7e726c9898c97ce10 100644
|
2020-03-31 11:38:18 +02:00
|
|
|
--- a/src/main/java/net/minecraft/server/Entity.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/Entity.java
|
2020-09-11 00:09:10 +02:00
|
|
|
@@ -1714,9 +1714,11 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
|
2020-03-31 11:38:18 +02:00
|
|
|
bworld = server.getWorld(worldName);
|
|
|
|
}
|
|
|
|
|
|
|
|
- if (bworld == null) {
|
2020-06-26 03:53:21 +02:00
|
|
|
- bworld = ((org.bukkit.craftbukkit.CraftServer) server).getServer().getWorldServer(World.OVERWORLD).getWorld();
|
2020-03-31 11:38:18 +02:00
|
|
|
- }
|
|
|
|
+ // Paper start - Move player to spawn point if spawn in unloaded world
|
2020-06-26 03:53:21 +02:00
|
|
|
+// 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
|
2020-03-31 11:38:18 +02:00
|
|
|
|
|
|
|
spawnIn(bworld == null ? null : ((CraftWorld) bworld).getHandle());
|
|
|
|
}
|