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-05-14 10:58:47 +02:00
|
|
|
index 9eab570e48817e18d10ddde95b3f80f7e4ea4766..0a7e4449407104fe6c0ff7d00bd1f32eb074e10a 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-05-14 10:58:47 +02:00
|
|
|
@@ -1792,9 +1792,11 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
|
2020-03-31 11:38:18 +02:00
|
|
|
bworld = server.getWorld(worldName);
|
|
|
|
}
|
|
|
|
|
|
|
|
- if (bworld == null) {
|
|
|
|
- bworld = ((org.bukkit.craftbukkit.CraftServer) server).getServer().getWorldServer(DimensionManager.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(DimensionManager.OVERWORLD).getWorld();
|
|
|
|
+ // }
|
|
|
|
+ // Paper end
|
|
|
|
|
|
|
|
spawnIn(bworld == null ? null : ((CraftWorld) bworld).getHandle());
|
|
|
|
}
|