From 5bdf0f1b1a4552f6def11f9ee2eb529bd9a8e607 Mon Sep 17 00:00:00 2001 From: Mariell Date: Tue, 6 Oct 2020 15:59:35 +0200 Subject: [PATCH] Updated Upstream (CraftBukkit) (#4622) Upstream has released updates that appears to apply and compile correctly. This update has not been tested by PaperMC and as with ANY update, please do your own testing CraftBukkit Changes: 1f4693a8 SPIGOT-6168: Fix error with Player.getBedSpawnLocation when world is unloaded while server running --- .../Fix-NPE-in-getBedSpawnLocation.patch | 28 ------------------- work/CraftBukkit | 2 +- 2 files changed, 1 insertion(+), 29 deletions(-) delete mode 100644 Spigot-Server-Patches/Fix-NPE-in-getBedSpawnLocation.patch diff --git a/Spigot-Server-Patches/Fix-NPE-in-getBedSpawnLocation.patch b/Spigot-Server-Patches/Fix-NPE-in-getBedSpawnLocation.patch deleted file mode 100644 index f87920a48a..0000000000 --- a/Spigot-Server-Patches/Fix-NPE-in-getBedSpawnLocation.patch +++ /dev/null @@ -1,28 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Josh Roy <10731363+JRoy@users.noreply.github.com> -Date: Fri, 28 Aug 2020 12:01:25 -0400 -Subject: [PATCH] Fix NPE in getBedSpawnLocation - - -diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -0,0 +0,0 @@ public class CraftPlayer extends CraftHumanEntity implements Player { - - @Override - public Location getBedSpawnLocation() { -- World world = getHandle().server.getWorldServer(getHandle().getSpawnDimension()).getWorld(); -+ WorldServer world = getHandle().server.getWorldServer(getHandle().getSpawnDimension()); // Paper - Fix NPE in getBedSpawnLocation - BlockPosition bed = getHandle().getSpawn(); - - if (world != null && bed != null) { -- Optional spawnLoc = EntityHuman.getBed(((CraftWorld) world).getHandle(), bed, getHandle().getSpawnAngle(), getHandle().isSpawnForced(), true); -+ Optional spawnLoc = EntityHuman.getBed(world, bed, getHandle().getSpawnAngle(), getHandle().isSpawnForced(), true); // Paper - Fix NPE in getBedSpawnLocation - if (spawnLoc.isPresent()) { - Vec3D vec = spawnLoc.get(); -- return new Location(world, vec.x, vec.y, vec.z); -+ return new Location(world.getWorld(), vec.x, vec.y, vec.z); // Paper - Fix NPE in getBedSpawnLocation - } - } - return null; diff --git a/work/CraftBukkit b/work/CraftBukkit index aa8206a857..1f4693a8c3 160000 --- a/work/CraftBukkit +++ b/work/CraftBukkit @@ -1 +1 @@ -Subproject commit aa8206a857fd0828f65a2a4511ddb836b6ee2448 +Subproject commit 1f4693a8c34c5f75accf0b656653b88d69d9fdb3