2020-05-06 09:48:49 +00:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
2020-03-31 09:38:18 +00: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.
|
|
|
|
|
2021-03-16 07:19:45 +00:00
|
|
|
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
2021-03-16 16:37:33 +00:00
|
|
|
index 8ca7012264528f17ac2e4f15ced96c774fa566d7..675d0cb32efc99f66c4d2b000bf49cf1c065a5e2 100644
|
2021-03-16 07:19:45 +00:00
|
|
|
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
|
|
|
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
2021-03-16 13:04:28 +00:00
|
|
|
@@ -1808,9 +1808,11 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, ne
|
2020-03-31 09:38:18 +00:00
|
|
|
bworld = server.getWorld(worldName);
|
|
|
|
}
|
|
|
|
|
|
|
|
- if (bworld == null) {
|
2020-06-26 01:53:21 +00:00
|
|
|
- bworld = ((org.bukkit.craftbukkit.CraftServer) server).getServer().getWorldServer(World.OVERWORLD).getWorld();
|
2020-03-31 09:38:18 +00:00
|
|
|
- }
|
|
|
|
+ // Paper start - Move player to spawn point if spawn in unloaded world
|
2020-06-26 01:53:21 +00: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 09:38:18 +00:00
|
|
|
|
|
|
|
spawnIn(bworld == null ? null : ((CraftWorld) bworld).getHandle());
|
|
|
|
}
|