diff options
author | Tahg <tahgtahv@gmail.com> | 2011-06-09 09:44:25 -0400 |
---|---|---|
committer | Tahg <tahgtahv@gmail.com> | 2011-06-09 09:46:55 -0400 |
commit | ca0711fdb3d8add9e545fdc7e39d1986d7fc403f (patch) | |
tree | bac8b885d48a60ffbf08ed6802423136d5a3e470 /src/main/java/net/minecraft/server | |
parent | 4a0eb0a4a11f84f9c3f940dab5b40c1b57b81af3 (diff) | |
download | craftbukkit-ca0711fdb3d8add9e545fdc7e39d1986d7fc403f.tar craftbukkit-ca0711fdb3d8add9e545fdc7e39d1986d7fc403f.tar.gz craftbukkit-ca0711fdb3d8add9e545fdc7e39d1986d7fc403f.tar.lz craftbukkit-ca0711fdb3d8add9e545fdc7e39d1986d7fc403f.tar.xz craftbukkit-ca0711fdb3d8add9e545fdc7e39d1986d7fc403f.zip |
fixed support for multiworld beds
Diffstat (limited to 'src/main/java/net/minecraft/server')
-rw-r--r-- | src/main/java/net/minecraft/server/EntityHuman.java | 3 | ||||
-rw-r--r-- | src/main/java/net/minecraft/server/ServerConfigurationManager.java | 8 |
2 files changed, 6 insertions, 5 deletions
diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java index eef5347f..2c68c7c4 100644 --- a/src/main/java/net/minecraft/server/EntityHuman.java +++ b/src/main/java/net/minecraft/server/EntityHuman.java @@ -38,7 +38,7 @@ public abstract class EntityHuman extends EntityLiving { // CraftBukkit start public boolean sleeping; public boolean fauxSleeping; - public String spawnWorld; + public String spawnWorld = ""; // CraftBukkit end public ChunkCoordinates A; public int sleepTicks; // CraftBukkit - private -> public @@ -760,6 +760,7 @@ public abstract class EntityHuman extends EntityLiving { public void a(ChunkCoordinates chunkcoordinates) { if (chunkcoordinates != null) { this.b = new ChunkCoordinates(chunkcoordinates); + this.spawnWorld = world.worldData.name; } else { this.b = null; } diff --git a/src/main/java/net/minecraft/server/ServerConfigurationManager.java b/src/main/java/net/minecraft/server/ServerConfigurationManager.java index 425736f6..316e7be7 100644 --- a/src/main/java/net/minecraft/server/ServerConfigurationManager.java +++ b/src/main/java/net/minecraft/server/ServerConfigurationManager.java @@ -216,7 +216,7 @@ public class ServerConfigurationManager { if(cw != null && chunkcoordinates != null) { ChunkCoordinates chunkcoordinates1 = EntityHuman.getBed(cw.getHandle(), chunkcoordinates); if (chunkcoordinates1 != null) { - location = new Location(cw, chunkcoordinates.x, chunkcoordinates.y, chunkcoordinates.z); + location = new Location(cw, chunkcoordinates1.x + 0.5, chunkcoordinates1.y + 0.1, chunkcoordinates1.z + 0.5); } else { entityplayer.netServerHandler.sendPacket(new Packet70Bed(0)); } @@ -239,10 +239,10 @@ public class ServerConfigurationManager { WorldServer worldserver = ((CraftWorld)location.getWorld()).getHandle(); worldserver.chunkProviderServer.getChunkAt((int) entityplayer.locX >> 4, (int) entityplayer.locZ >> 4); - while (worldserver.getEntities(entityplayer, entityplayer.boundingBox).size() != 0) { - entityplayer.setPosition(entityplayer.locX, entityplayer.locY + 1.0D, entityplayer.locZ); + while (worldserver.getTypeId(location.getBlockX(), location.getBlockY(), location.getBlockZ()) != 0 || + worldserver.getTypeId(location.getBlockX(), location.getBlockY() + 1, location.getBlockZ()) != 0) { + location.setY(location.getY() + 1); } - byte actualDimension = (byte) (worldserver.getWorld().getEnvironment().getId()); entityplayer.netServerHandler.sendPacket(new Packet9Respawn((byte) (actualDimension >= 0 ? -1 : 0))); entityplayer.netServerHandler.sendPacket(new Packet9Respawn(actualDimension)); |