diff options
author | Dinnerbone <dinnerbone@dinnerbone.com> | 2011-02-06 02:04:15 +0000 |
---|---|---|
committer | Dinnerbone <dinnerbone@dinnerbone.com> | 2011-02-07 01:51:05 +0000 |
commit | 590b3874a85404c54fe2f46e76e72e8ff09fcdf6 (patch) | |
tree | 47385f54157e974a4d0ace0090092454bbd48eba | |
parent | 4c9f1a2275c61701727cd0a4c32192fe527822b4 (diff) | |
download | craftbukkit-590b3874a85404c54fe2f46e76e72e8ff09fcdf6.tar craftbukkit-590b3874a85404c54fe2f46e76e72e8ff09fcdf6.tar.gz craftbukkit-590b3874a85404c54fe2f46e76e72e8ff09fcdf6.tar.lz craftbukkit-590b3874a85404c54fe2f46e76e72e8ff09fcdf6.tar.xz craftbukkit-590b3874a85404c54fe2f46e76e72e8ff09fcdf6.zip |
Fixed various multiworld teleporting issues
-rw-r--r-- | src/main/java/net/minecraft/server/ServerConfigurationManager.java | 2 | ||||
-rw-r--r-- | src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java | 23 |
2 files changed, 18 insertions, 7 deletions
diff --git a/src/main/java/net/minecraft/server/ServerConfigurationManager.java b/src/main/java/net/minecraft/server/ServerConfigurationManager.java index a9e3a906..1532f97c 100644 --- a/src/main/java/net/minecraft/server/ServerConfigurationManager.java +++ b/src/main/java/net/minecraft/server/ServerConfigurationManager.java @@ -27,7 +27,7 @@ public class ServerConfigurationManager { public static Logger a = Logger.getLogger("Minecraft"); public List b = new ArrayList(); - private MinecraftServer c; + public MinecraftServer c; // Craftbukkit - public public PlayerManager d; // Craftbukkit - public private int e; private Set f = new HashSet(); diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java index 3b835a45..f59b6b70 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -8,6 +8,8 @@ import net.minecraft.server.ItemInWorldManager; import net.minecraft.server.Packet; import net.minecraft.server.Packet3Chat; import net.minecraft.server.Packet6SpawnPosition; +import net.minecraft.server.Packet9Respawn; +import net.minecraft.server.ServerConfigurationManager; import net.minecraft.server.WorldServer; import org.bukkit.Location; import org.bukkit.craftbukkit.CraftServer; @@ -115,18 +117,27 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @Override public void teleportTo(Location location) { boolean worldChange = location.getWorld() != getWorld(); + ServerConfigurationManager manager = server.getHandle(); + if (worldChange) { - // Unload player from current chunks - server.getServer().f.d.b(entity); + manager.c.k.a(entity); + manager.c.k.b(entity); + manager.d.b(entity); + entity.world.e(entity); + + entity.world = ((CraftWorld)location.getWorld()).getHandle(); entity.c = new ItemInWorldManager(((CraftWorld)location.getWorld()).getHandle()); entity.c.a = entity; + + ((WorldServer)entity.world).A.d((int) entity.locX >> 4, (int) entity.locZ >> 4); } - entity.world = ((CraftWorld)location.getWorld()).getHandle(); - entity.b(location.getX(), location.getY(), location.getZ(), location.getYaw(), location.getPitch()); + + entity.a.a(location.getX(), location.getY(), location.getZ(), location.getYaw(), location.getPitch()); + if (worldChange) { - // Forceload the chunks around player - server.getServer().f.d.a(entity); + manager.d.a(entity); + entity.world.a(entity); } } } |