geforkt von Mirrors/Paper
Fix NPE in getBedSpawnLocation (#4238)
Dieser Commit ist enthalten in:
Ursprung
742b4c6a07
Commit
a9c8e493d3
28
Spigot-Server-Patches/Fix-NPE-in-getBedSpawnLocation.patch
Normale Datei
28
Spigot-Server-Patches/Fix-NPE-in-getBedSpawnLocation.patch
Normale Datei
@ -0,0 +1,28 @@
|
||||
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<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;
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren