Paper/Spigot-Server-Patches/0567-Fix-NPE-in-getBedSpawnLocation.patch
Mariell Hoversholm 654b792caf Updated Upstream (CraftBukkit)
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:
a339310c #755: Fix NPE when calling getInventory() for virtual EnderChests
2577f9bf Increase outdated build delay
1dabfdc8 #754: Fix pre-1.16 serialized SkullMeta being broken on 1.16+, losing textures
2020-09-27 11:04:51 -04:00

29 Zeilen
1.7 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: JRoy <joshroy126@gmail.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 b97be51c6859fa2d45c07c853980adb05d11b65f..715d2c5e888b4a5c955d2dee2429757a27b50b00 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -874,14 +874,14 @@ 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<Vec3D> spawnLoc = EntityHuman.getBed(((CraftWorld) world).getHandle(), bed, getHandle().getSpawnAngle(), getHandle().isSpawnForced(), true);
+ Optional<Vec3D> 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;