public boolean teleport(Location location, TeleportCause cause) {
if (entity.ridingEntity != null || entity.riddenByEntity != null || entity.isDead) {
return false;
}
// Spigot start
net.minecraft.world.WorldServer newWorld = ((CraftWorld) location.getWorld()).getHandle();
if (newWorld != entity.worldObj) {
entity.teleportTo(location, cause.isPortal());
return true;
}
// Spigot end
entity.setPositionAndRotation(location.getX(), location.getY(), location.getZ(), location.getYaw(), location.getPitch());
//entity.worldObj.entityJoinedWorld(entity, false); // PaperSpigot - Prevent Server from thinking a player teleporting within the world has joined the world
// entity.setLocation() throws no event, and so cannot be cancelled
return true;
}
CraftEntity.java 文件源码
java
阅读 17
收藏 0
点赞 0
评论 0
项目:Thermos
作者:
评论列表
文章目录