summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEvilSeph <evilseph@unaligned.org>2011-06-10 06:33:25 -0400
committerEvilSeph <evilseph@unaligned.org>2011-06-10 06:33:25 -0400
commita9e7b56ef26df7dbe63e65d054b82b37e5abf046 (patch)
tree802ef402c2ccbf5591eb1e6107b3c999777cf8df /src
parenta98f4f89348196abdbaa2a55a2b450bbbbe257f5 (diff)
downloadcraftbukkit-a9e7b56ef26df7dbe63e65d054b82b37e5abf046.tar
craftbukkit-a9e7b56ef26df7dbe63e65d054b82b37e5abf046.tar.gz
craftbukkit-a9e7b56ef26df7dbe63e65d054b82b37e5abf046.tar.lz
craftbukkit-a9e7b56ef26df7dbe63e65d054b82b37e5abf046.tar.xz
craftbukkit-a9e7b56ef26df7dbe63e65d054b82b37e5abf046.zip
Improved handling of being sent to your bed spawn if the world saved in your player.dat no longer exists.
Diffstat (limited to 'src')
-rw-r--r--src/main/java/net/minecraft/server/EntityPlayer.java10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java
index dbc6edc1..305132bf 100644
--- a/src/main/java/net/minecraft/server/EntityPlayer.java
+++ b/src/main/java/net/minecraft/server/EntityPlayer.java
@@ -64,22 +64,22 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
public void a(World world) {
super.a(world);
// CraftBukkit - world fallback code, either respawn location or global spawn
- if(world == null) {
+ if (world == null) {
dead = false;
ChunkCoordinates position = null;
if (!spawnWorld.isEmpty()) {
CraftWorld cw = (CraftWorld)Bukkit.getServer().getWorld(spawnWorld);
- if (cw != null) {
+ if (cw != null && M() != null) {
world = cw.getHandle();
- position = M();
+ position = EntityHuman.getBed(cw.getHandle(), M());
}
}
- if (world == null) {
+ if (world == null || position == null) {
world = ((CraftWorld)Bukkit.getServer().getWorlds().get(0)).getHandle();
position = world.getSpawn();
}
this.world = world;
- setPosition(position.x, position.y, position.z);
+ setPosition(position.x + 0.5, position.y, position.z + 0.5);
}
this.dimension = ((WorldServer)this.world).dimension;
// CraftBukkit end