2021-06-11 14:02:28 +02:00
|
|
|
From 0000000000000000000000000000000000000000 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/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
2022-10-09 08:52:09 +02:00
|
|
|
index 5de420c0a2f0881abb03c16b2621d081ef7ad4fd..58a8bbda3ddff1ed561d9035d45176c6ca689115 100644
|
2021-06-11 14:02:28 +02:00
|
|
|
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
|
|
|
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
2022-10-09 08:52:09 +02:00
|
|
|
@@ -2162,9 +2162,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
2021-06-11 14:02:28 +02:00
|
|
|
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
|
|
|
|
|
2021-06-14 03:06:38 +02:00
|
|
|
((ServerPlayer) this).setLevel(bworld == null ? null : ((CraftWorld) bworld).getHandle());
|
2021-06-11 14:02:28 +02:00
|
|
|
}
|