本文整理了Java中net.minecraft.entity.Entity.removePassengers()
方法的一些代码示例,展示了Entity.removePassengers()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Entity.removePassengers()
方法的具体详情如下:
包路径:net.minecraft.entity.Entity
类名称:Entity
方法名:removePassengers
暂无
代码示例来源:origin: SleepyTrousers/EnderIO
private static boolean doTeleport(@Nonnull World world, @Nonnull Entity entity, double targetX, double targetY, double targetZ) {
if (entity instanceof EntityLivingBase) {
return doTeleport(world, (EntityLivingBase) entity, targetX, targetY, targetZ);
}
if (entity.isRiding()) {
entity.dismountRidingEntity();
}
if (entity.isBeingRidden()) {
entity.removePassengers();
}
entity.setPositionAndRotation(targetX, targetY, targetZ, entity.rotationYaw, entity.rotationPitch);
return true;
}
代码示例来源:origin: CoFH/CoFHCore
public static void transferEntityToDimension(Entity entity, double x, double y, double z, int dimension, PlayerList manager) {
if (entity instanceof EntityPlayerMP) {
transferPlayerToDimension((EntityPlayerMP) entity, dimension, manager);
return;
}
WorldServer worldserver = manager.getServerInstance().getWorld(entity.dimension);
entity.dimension = dimension;
WorldServer worldserver1 = manager.getServerInstance().getWorld(entity.dimension);
worldserver.removeEntityDangerously(entity);
if (entity.isBeingRidden()) {
entity.removePassengers();
}
if (entity.isRiding()) {
entity.dismountRidingEntity();
}
entity.isDead = false;
transferEntityToWorld(entity, x, y, z, worldserver, worldserver1);
}
代码示例来源:origin: CoFH/CoFHCore
public static void transferEntityToDimension(Entity entity, int dimension, PlayerList manager) {
if (entity instanceof EntityPlayerMP) {
transferPlayerToDimension((EntityPlayerMP) entity, dimension, manager);
return;
}
WorldServer worldserver = manager.getServerInstance().getWorld(entity.dimension);
entity.dimension = dimension;
WorldServer worldserver1 = manager.getServerInstance().getWorld(entity.dimension);
worldserver.removeEntityDangerously(entity);
if (entity.isBeingRidden()) {
entity.removePassengers();
}
if (entity.isRiding()) {
entity.dismountRidingEntity();
}
entity.isDead = false;
transferEntityToWorld(entity, worldserver, worldserver1);
}
内容来源于网络,如有侵权,请联系作者删除!