Attempt to clear loaded chunks during multiworld teleportation

By: Dinnerbone <dinnerbone@dinnerbone.com>
This commit is contained in:
CraftBukkit/Spigot
2011-02-05 20:51:22 +00:00
parent 4da4e3ed2e
commit 5ddeb60d33
2 changed files with 59 additions and 6 deletions

View File

@@ -10,6 +10,7 @@ import net.minecraft.server.Packet6SpawnPosition;
import net.minecraft.server.WorldServer;
import org.bukkit.Location;
import org.bukkit.craftbukkit.CraftServer;
import org.bukkit.craftbukkit.CraftWorld;
import org.bukkit.entity.Player;
public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -109,4 +110,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
public boolean performCommand(String command) {
return server.dispatchCommand(this, command);
}
@Override
public void teleportTo(Location location) {
if (location.getWorld() != getWorld()) {
server.getServer().f.d.b(entity);
}
entity.world = ((CraftWorld)location.getWorld()).getHandle();
entity.b(location.getX(), location.getY(), location.getZ(), location.getYaw(), location.getPitch());
}
}