SPIGOT-4900: Rearchitect multiworld support for better compat with new villager AI

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot
2019-05-12 11:15:48 +10:00
parent 8b207fdf78
commit b407bebd8d
22 changed files with 208 additions and 227 deletions

View File

@@ -465,7 +465,7 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
// Let the server handle cross world teleports
if (!location.getWorld().equals(getWorld())) {
entity.teleportTo(((CraftWorld) location.getWorld()).getHandle().dimension, new BlockPosition(location.getX(), location.getY(), location.getZ()));
entity.teleportTo(((CraftWorld) location.getWorld()).getHandle().getWorldProvider().getDimensionManager(), new BlockPosition(location.getX(), location.getY(), location.getZ()));
return true;
}

View File

@@ -651,7 +651,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
if (fromWorld == toWorld) {
entity.playerConnection.teleport(to);
} else {
server.getHandle().moveToWorld(entity, toWorld.dimension, true, to, true);
server.getHandle().moveToWorld(entity, toWorld.getWorldProvider().getDimensionManager(), true, to, true);
}
return true;
}