summaryrefslogtreecommitdiffstats
path: root/src/main/java/net/minecraft/server/ServerConfigurationManager.java
diff options
context:
space:
mode:
authorTahg <tahgtahv@gmail.com>2011-06-09 14:24:21 -0400
committerTahg <tahgtahv@gmail.com>2011-06-09 14:24:21 -0400
commitbaa92bdd06e7d276339128ef69fc5bd53298f181 (patch)
tree76bbb3cbafc064db834bddefc3dfd5c3c5417f8d /src/main/java/net/minecraft/server/ServerConfigurationManager.java
parentca0711fdb3d8add9e545fdc7e39d1986d7fc403f (diff)
downloadcraftbukkit-baa92bdd06e7d276339128ef69fc5bd53298f181.tar
craftbukkit-baa92bdd06e7d276339128ef69fc5bd53298f181.tar.gz
craftbukkit-baa92bdd06e7d276339128ef69fc5bd53298f181.tar.lz
craftbukkit-baa92bdd06e7d276339128ef69fc5bd53298f181.tar.xz
craftbukkit-baa92bdd06e7d276339128ef69fc5bd53298f181.zip
reverted some changes that broke stuff
Diffstat (limited to 'src/main/java/net/minecraft/server/ServerConfigurationManager.java')
-rw-r--r--src/main/java/net/minecraft/server/ServerConfigurationManager.java51
1 files changed, 29 insertions, 22 deletions
diff --git a/src/main/java/net/minecraft/server/ServerConfigurationManager.java b/src/main/java/net/minecraft/server/ServerConfigurationManager.java
index 316e7be7..3458ab6a 100644
--- a/src/main/java/net/minecraft/server/ServerConfigurationManager.java
+++ b/src/main/java/net/minecraft/server/ServerConfigurationManager.java
@@ -210,15 +210,19 @@ public class ServerConfigurationManager {
this.a(entityplayer.dimension).removePlayer(entityplayer);
this.players.remove(entityplayer);
this.server.a(entityplayer.dimension).removeEntity(entityplayer);
+ ChunkCoordinates chunkcoordinates = entityplayer.M();
+
+ // CraftBukkit start
+ EntityPlayer entityplayer1 = entityplayer;
+
if (location == null) {
- ChunkCoordinates chunkcoordinates = entityplayer.M();
CraftWorld cw = (CraftWorld) this.server.server.getWorld(entityplayer.spawnWorld);
if(cw != null && chunkcoordinates != null) {
ChunkCoordinates chunkcoordinates1 = EntityHuman.getBed(cw.getHandle(), chunkcoordinates);
if (chunkcoordinates1 != null) {
location = new Location(cw, chunkcoordinates1.x + 0.5, chunkcoordinates1.y + 0.1, chunkcoordinates1.z + 0.5);
} else {
- entityplayer.netServerHandler.sendPacket(new Packet70Bed(0));
+ entityplayer1.netServerHandler.sendPacket(new Packet70Bed(0));
}
}
if (location == null) {
@@ -237,30 +241,33 @@ public class ServerConfigurationManager {
location.setWorld(this.server.a(i).getWorld());
}
WorldServer worldserver = ((CraftWorld)location.getWorld()).getHandle();
- worldserver.chunkProviderServer.getChunkAt((int) entityplayer.locX >> 4, (int) entityplayer.locZ >> 4);
+ entityplayer1.setLocation(location.getX(), location.getY(), location.getZ(), location.getYaw(), location.getPitch());
+ // CraftBukkit end
+
+ worldserver.chunkProviderServer.getChunkAt((int) entityplayer1.locX >> 4, (int) entityplayer1.locZ >> 4);
- 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);
+ while (worldserver.getEntities(entityplayer1, entityplayer1.boundingBox).size() != 0) {
+ entityplayer1.setPosition(entityplayer1.locX, entityplayer1.locY + 1.0D, entityplayer1.locZ);
}
+
+ // CraftBukkit start
byte actualDimension = (byte) (worldserver.getWorld().getEnvironment().getId());
- entityplayer.netServerHandler.sendPacket(new Packet9Respawn((byte) (actualDimension >= 0 ? -1 : 0)));
- entityplayer.netServerHandler.sendPacket(new Packet9Respawn(actualDimension));
- entityplayer.a(worldserver);
- entityplayer.dead = false;
- entityplayer.netServerHandler.teleport(location);
- this.a(entityplayer, worldserver);
- this.a(entityplayer.dimension).addPlayer(entityplayer);
- worldserver.addEntity(entityplayer);
- this.players.add(entityplayer);
- this.g(entityplayer);
- entityplayer.w();
- return entityplayer;
+ entityplayer1.netServerHandler.sendPacket(new Packet9Respawn((byte) (actualDimension >= 0 ? -1 : 0)));
+ entityplayer1.netServerHandler.sendPacket(new Packet9Respawn(actualDimension));
+ entityplayer1.a(worldserver);
+ entityplayer1.dead = false;
// CraftBukkit end
+ entityplayer1.netServerHandler.a(entityplayer1.locX, entityplayer1.locY, entityplayer1.locZ, entityplayer1.yaw, entityplayer1.pitch);
+ this.a(entityplayer1, worldserver);
+ this.a(entityplayer1.dimension).addPlayer(entityplayer1);
+ worldserver.addEntity(entityplayer1);
+ this.players.add(entityplayer1);
+ this.g(entityplayer1); // CraftBukkit
+ entityplayer1.w();
+ return entityplayer1;
}
- // CraftBukkit - changed signature
- public EntityPlayer f(EntityPlayer entityplayer) {
+ public void f(EntityPlayer entityplayer) {
WorldServer worldserver = this.server.a(entityplayer.dimension);
boolean flag = false;
byte b0;
@@ -284,7 +291,7 @@ public class ServerConfigurationManager {
PlayerPortalEvent event = new PlayerPortalEvent((Player)entityplayer.getBukkitEntity(),startLocation,endLocation);
Bukkit.getServer().getPluginManager().callEvent(event);
if (event.isCancelled()) {
- return entityplayer;
+ return;
}
// entityplayer.dimension = b0;
@@ -331,7 +338,7 @@ public class ServerConfigurationManager {
this.g(entityplayer);
*/ // CraftBukkit end
// CraftBukkit - defer for actual teleportation
- return a(entityplayer, b0, new Location(null, entityplayer.locX, entityplayer.locY, entityplayer.locZ));
+ a(entityplayer, b0, new Location(null, entityplayer.locX, entityplayer.locY, entityplayer.locZ));
}
public void b() {