diff options
author | sk89q <the.sk89q@gmail.com> | 2011-04-11 17:07:20 -0700 |
---|---|---|
committer | sk89q <the.sk89q@gmail.com> | 2011-04-11 17:07:20 -0700 |
commit | 8de85b8afbac46b845799dc75eaa54fd1c9fd66d (patch) | |
tree | 90f53cf74b8e90af1be916e734aa1c739ff61295 /src/main/java/net | |
parent | 86c467cb50c3fabf48838b0d5c213e277fc49a8d (diff) | |
download | craftbukkit-8de85b8afbac46b845799dc75eaa54fd1c9fd66d.tar craftbukkit-8de85b8afbac46b845799dc75eaa54fd1c9fd66d.tar.gz craftbukkit-8de85b8afbac46b845799dc75eaa54fd1c9fd66d.tar.lz craftbukkit-8de85b8afbac46b845799dc75eaa54fd1c9fd66d.tar.xz craftbukkit-8de85b8afbac46b845799dc75eaa54fd1c9fd66d.zip |
Fixed potential NPE with bed leave event.
Diffstat (limited to 'src/main/java/net')
-rw-r--r-- | src/main/java/net/minecraft/server/EntityHuman.java | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java index 50835358..f77ea7cf 100644 --- a/src/main/java/net/minecraft/server/EntityHuman.java +++ b/src/main/java/net/minecraft/server/EntityHuman.java @@ -662,7 +662,12 @@ public abstract class EntityHuman extends EntityLiving { if (this.getBukkitEntity() instanceof Player) { Player player = (Player) this.getBukkitEntity(); CraftServer server = ((WorldServer) world).getServer(); - org.bukkit.block.Block bed = ((WorldServer) world).getWorld().getBlockAt(this.b.a, this.b.b, this.b.c); + org.bukkit.block.Block bed; + if (chunkcoordinates != null) { + bed = ((WorldServer) world).getWorld().getBlockAt(chunkcoordinates.a, chunkcoordinates.b, chunkcoordinates.c); + } else { + bed = ((WorldServer) world).getWorld().getBlockAt(player.getLocation()); + } PlayerBedLeaveEvent event = new PlayerBedLeaveEvent(player, bed); server.getPluginManager().callEvent(event); } |