summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTaylor Kelly <tkelly910@gmail.com>2011-02-22 19:02:06 +0100
committerTaylor Kelly <tkelly910@gmail.com>2011-02-22 19:02:06 +0100
commita124bfdab59cc9a9d8369425027e61eccd1d62fb (patch)
tree12789d0f2205075452f8d542f7b7e75a00dbd77d
parent96435cfc76e129f278febe8c478a8cf6cc48e875 (diff)
downloadcraftbukkit-a124bfdab59cc9a9d8369425027e61eccd1d62fb.tar
craftbukkit-a124bfdab59cc9a9d8369425027e61eccd1d62fb.tar.gz
craftbukkit-a124bfdab59cc9a9d8369425027e61eccd1d62fb.tar.lz
craftbukkit-a124bfdab59cc9a9d8369425027e61eccd1d62fb.tar.xz
craftbukkit-a124bfdab59cc9a9d8369425027e61eccd1d62fb.zip
Fix PlayerRespawnEvent for multi-worlds
-rw-r--r--src/main/java/net/minecraft/server/ServerConfigurationManager.java5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/main/java/net/minecraft/server/ServerConfigurationManager.java b/src/main/java/net/minecraft/server/ServerConfigurationManager.java
index 553b9647..1de040ef 100644
--- a/src/main/java/net/minecraft/server/ServerConfigurationManager.java
+++ b/src/main/java/net/minecraft/server/ServerConfigurationManager.java
@@ -15,6 +15,7 @@ import java.util.logging.Logger;
// CraftBukkit start
import org.bukkit.Location;
import org.bukkit.craftbukkit.CraftServer;
+import org.bukkit.craftbukkit.CraftWorld;
import org.bukkit.entity.Player;
import org.bukkit.event.Event;
import org.bukkit.event.Event.Type;
@@ -168,11 +169,15 @@ public class ServerConfigurationManager {
Location respawnLocation = new Location(respawnPlayer.getWorld(), entityplayer1.locX, entityplayer1.locY, entityplayer1.locZ, entityplayer1.yaw, entityplayer1.pitch);
PlayerRespawnEvent respawnEvent = new PlayerRespawnEvent(Event.Type.PLAYER_RESPAWN, respawnPlayer, respawnLocation );
server.getPluginManager().callEvent(respawnEvent);
+ entityplayer1.world = ((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();
+ entityplayer1.c = new ItemInWorldManager(((CraftWorld)respawnEvent.getRespawnLocation().getWorld()).getHandle());
+ entityplayer1.c.a = entityplayer1;
+ ((WorldServer)entityplayer1.world).A.d((int) entityplayer1.locX >> 4, (int) entityplayer1.locZ >> 4);
// CraftBukkit end
entityplayer1.a.b((Packet) (new Packet9Respawn()));