moved respawn event

This commit is contained in:
Tahg 2011-05-31 20:10:21 -04:00
parent 8835cb905f
commit 66109d6e57

View File

@ -235,16 +235,8 @@ public class ServerConfigurationManager {
entityplayer1.netServerHandler.sendPacket(new Packet70Bed(0)); entityplayer1.netServerHandler.sendPacket(new Packet70Bed(0));
} }
} }
}
else {
entityplayer1.setPositionRotation(entityplayer.locX, entityplayer.locY, entityplayer.locZ, entityplayer.yaw, entityplayer.pitch);
entityplayer1.inventory = entityplayer.inventory;
entityplayer1.activeContainer = entityplayer.activeContainer;
entityplayer1.defaultContainer = entityplayer.defaultContainer;
}
Player respawnPlayer = cserver.getPlayer(entityplayer); Player respawnPlayer = cserver.getPlayer(entityplayer);
Location respawnLocation = new Location(respawnPlayer.getWorld(), entityplayer1.locX, entityplayer1.locY, entityplayer1.locZ, entityplayer1.yaw, entityplayer1.pitch); Location respawnLocation = new Location(cserver.getPlayer(entityplayer1).getWorld(), entityplayer1.locX, entityplayer1.locY, entityplayer1.locZ, entityplayer1.yaw, entityplayer1.pitch);
PlayerRespawnEvent respawnEvent = new PlayerRespawnEvent(respawnPlayer, respawnLocation); PlayerRespawnEvent respawnEvent = new PlayerRespawnEvent(respawnPlayer, respawnLocation);
cserver.getPluginManager().callEvent(respawnEvent); cserver.getPluginManager().callEvent(respawnEvent);
@ -255,7 +247,13 @@ public class ServerConfigurationManager {
entityplayer1.locZ = respawnEvent.getRespawnLocation().getZ(); entityplayer1.locZ = respawnEvent.getRespawnLocation().getZ();
entityplayer1.yaw = respawnEvent.getRespawnLocation().getYaw(); entityplayer1.yaw = respawnEvent.getRespawnLocation().getYaw();
entityplayer1.pitch = respawnEvent.getRespawnLocation().getPitch(); entityplayer1.pitch = respawnEvent.getRespawnLocation().getPitch();
// CraftBukkit end }
else {
entityplayer1.setPositionRotation(entityplayer.locX, entityplayer.locY, entityplayer.locZ, entityplayer.yaw, entityplayer.pitch);
entityplayer1.inventory = entityplayer.inventory;
entityplayer1.activeContainer = entityplayer.activeContainer;
entityplayer1.defaultContainer = entityplayer.defaultContainer;
}
worldserver.chunkProviderServer.getChunkAt((int) entityplayer1.locX >> 4, (int) entityplayer1.locZ >> 4); worldserver.chunkProviderServer.getChunkAt((int) entityplayer1.locX >> 4, (int) entityplayer1.locZ >> 4);
@ -266,6 +264,7 @@ public class ServerConfigurationManager {
byte actualDimension = (byte) (worldserver.getWorld().getEnvironment().getId()); byte actualDimension = (byte) (worldserver.getWorld().getEnvironment().getId());
entityplayer1.netServerHandler.sendPacket(new Packet9Respawn((byte) (actualDimension >= 0 ? -1 : 0))); // CraftBukkit entityplayer1.netServerHandler.sendPacket(new Packet9Respawn((byte) (actualDimension >= 0 ? -1 : 0))); // CraftBukkit
entityplayer1.netServerHandler.sendPacket(new Packet9Respawn(actualDimension)); // CraftBukkit entityplayer1.netServerHandler.sendPacket(new Packet9Respawn(actualDimension)); // CraftBukkit
// CraftBukkit end
entityplayer1.netServerHandler.a(entityplayer1.locX, entityplayer1.locY, entityplayer1.locZ, entityplayer1.yaw, entityplayer1.pitch); entityplayer1.netServerHandler.a(entityplayer1.locX, entityplayer1.locY, entityplayer1.locZ, entityplayer1.yaw, entityplayer1.pitch);
this.a(entityplayer1, worldserver); this.a(entityplayer1, worldserver);
this.a(entityplayer1.dimension).addPlayer(entityplayer1); this.a(entityplayer1.dimension).addPlayer(entityplayer1);