summaryrefslogtreecommitdiffstats
path: root/src/main/java
diff options
context:
space:
mode:
authorEdGruberman <ed@rjump.com>2012-12-09 17:37:37 -0600
committerfeildmaster <admin@feildmaster.com>2012-12-10 01:40:20 -0600
commitf18b3cdc769e145c0823f4b43ff4f8271fdfb617 (patch)
tree6f96561fa8e27a6fa1c853b0c5d71475764c50b9 /src/main/java
parent4d2a92ed475941088d1fee5d28992f2534ba1678 (diff)
downloadcraftbukkit-f18b3cdc769e145c0823f4b43ff4f8271fdfb617.tar
craftbukkit-f18b3cdc769e145c0823f4b43ff4f8271fdfb617.tar.gz
craftbukkit-f18b3cdc769e145c0823f4b43ff4f8271fdfb617.tar.lz
craftbukkit-f18b3cdc769e145c0823f4b43ff4f8271fdfb617.tar.xz
craftbukkit-f18b3cdc769e145c0823f4b43ff4f8271fdfb617.zip
[Bleeding] Fix NPE with a null bedSpawnLocation. Fixes BUKKIT-1500
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/net/minecraft/server/EntityHuman.java1
-rw-r--r--src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java8
2 files changed, 7 insertions, 2 deletions
diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java
index 64abd730..1e5723d3 100644
--- a/src/main/java/net/minecraft/server/EntityHuman.java
+++ b/src/main/java/net/minecraft/server/EntityHuman.java
@@ -1094,6 +1094,7 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
} else {
this.c = null;
this.d = false;
+ this.spawnWorld = ""; // CraftBukkit
}
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index efa4e05a..3c1ff730 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -614,8 +614,12 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
}
public void setBedSpawnLocation(Location location, boolean override) {
- getHandle().setRespawnPosition(new ChunkCoordinates(location.getBlockX(), location.getBlockY(), location.getBlockZ()), override);
- getHandle().spawnWorld = location.getWorld().getName();
+ if (location == null) {
+ getHandle().setRespawnPosition(null, override);
+ } else {
+ getHandle().setRespawnPosition(new ChunkCoordinates(location.getBlockX(), location.getBlockY(), location.getBlockZ()), override);
+ getHandle().spawnWorld = location.getWorld().getName();
+ }
}
public void hidePlayer(Player player) {