diff options
author | Tahg <tahgtahv@gmail.com> | 2011-05-31 20:10:21 -0400 |
---|---|---|
committer | Tahg <tahgtahv@gmail.com> | 2011-05-31 20:10:21 -0400 |
commit | 66109d6e57047dbb5372c95c7e634c6f6167b402 (patch) | |
tree | ae86e9551da7474267087067bc26e93570665a8c /src | |
parent | 8835cb905fcd8117c1f15940822c77ca41bcd97c (diff) | |
download | craftbukkit-66109d6e57047dbb5372c95c7e634c6f6167b402.tar craftbukkit-66109d6e57047dbb5372c95c7e634c6f6167b402.tar.gz craftbukkit-66109d6e57047dbb5372c95c7e634c6f6167b402.tar.lz craftbukkit-66109d6e57047dbb5372c95c7e634c6f6167b402.tar.xz craftbukkit-66109d6e57047dbb5372c95c7e634c6f6167b402.zip |
moved respawn event
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/net/minecraft/server/ServerConfigurationManager.java | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/src/main/java/net/minecraft/server/ServerConfigurationManager.java b/src/main/java/net/minecraft/server/ServerConfigurationManager.java index b310bcc4..11df7bbe 100644 --- a/src/main/java/net/minecraft/server/ServerConfigurationManager.java +++ b/src/main/java/net/minecraft/server/ServerConfigurationManager.java @@ -235,6 +235,18 @@ public class ServerConfigurationManager { entityplayer1.netServerHandler.sendPacket(new Packet70Bed(0)); } } + Player respawnPlayer = cserver.getPlayer(entityplayer); + Location respawnLocation = new Location(cserver.getPlayer(entityplayer1).getWorld(), entityplayer1.locX, entityplayer1.locY, entityplayer1.locZ, entityplayer1.yaw, entityplayer1.pitch); + + PlayerRespawnEvent respawnEvent = new PlayerRespawnEvent(respawnPlayer, respawnLocation); + cserver.getPluginManager().callEvent(respawnEvent); + + worldserver = ((CraftWorld)respawnEvent.getRespawnLocation().getWorld()).getHandle(); + entityplayer1.locX = respawnEvent.getRespawnLocation().getX(); + entityplayer1.locY = respawnEvent.getRespawnLocation().getY(); + entityplayer1.locZ = respawnEvent.getRespawnLocation().getZ(); + entityplayer1.yaw = respawnEvent.getRespawnLocation().getYaw(); + entityplayer1.pitch = respawnEvent.getRespawnLocation().getPitch(); } else { entityplayer1.setPositionRotation(entityplayer.locX, entityplayer.locY, entityplayer.locZ, entityplayer.yaw, entityplayer.pitch); @@ -243,20 +255,6 @@ public class ServerConfigurationManager { entityplayer1.defaultContainer = entityplayer.defaultContainer; } - Player respawnPlayer = cserver.getPlayer(entityplayer); - Location respawnLocation = new Location(respawnPlayer.getWorld(), entityplayer1.locX, entityplayer1.locY, entityplayer1.locZ, entityplayer1.yaw, entityplayer1.pitch); - - PlayerRespawnEvent respawnEvent = new PlayerRespawnEvent(respawnPlayer, respawnLocation); - cserver.getPluginManager().callEvent(respawnEvent); - - worldserver = ((CraftWorld)respawnEvent.getRespawnLocation().getWorld()).getHandle(); - entityplayer1.locX = respawnEvent.getRespawnLocation().getX(); - entityplayer1.locY = respawnEvent.getRespawnLocation().getY(); - entityplayer1.locZ = respawnEvent.getRespawnLocation().getZ(); - entityplayer1.yaw = respawnEvent.getRespawnLocation().getYaw(); - entityplayer1.pitch = respawnEvent.getRespawnLocation().getPitch(); - // CraftBukkit end - worldserver.chunkProviderServer.getChunkAt((int) entityplayer1.locX >> 4, (int) entityplayer1.locZ >> 4); while (worldserver.getEntities(entityplayer1, entityplayer1.boundingBox).size() != 0) { @@ -266,6 +264,7 @@ public class ServerConfigurationManager { byte actualDimension = (byte) (worldserver.getWorld().getEnvironment().getId()); entityplayer1.netServerHandler.sendPacket(new Packet9Respawn((byte) (actualDimension >= 0 ? -1 : 0))); // CraftBukkit entityplayer1.netServerHandler.sendPacket(new Packet9Respawn(actualDimension)); // CraftBukkit + // 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); |