本文整理了Java中net.minecraft.entity.Entity.isBeingRidden()
方法的一些代码示例,展示了Entity.isBeingRidden()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Entity.isBeingRidden()
方法的具体详情如下:
包路径:net.minecraft.entity.Entity
类名称:Entity
方法名:isBeingRidden
暂无
代码示例来源: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: vadis365/TheErebus
@Override
public void onEntityCollidedWithBlock(World worldIn, BlockPos pos, IBlockState state, Entity entityIn) {
if (!entityIn.isRiding() && !entityIn.isBeingRidden() && entityIn.timeUntilPortal <= 0) {
if (entityIn.dimension == 0)
TeleporterHandler.transferToErebus(entityIn);
else
TeleporterHandler.transferToOverworld(entityIn);
if (entityIn != null)
entityIn.timeUntilPortal = ConfigHandler.INSTANCE.portalCooldown * 20;
return;
}
}
代码示例来源:origin: vadis365/TheErebus
@SuppressWarnings("unchecked")
protected Entity findEnemyToAttack() {
List<Entity> list = getEntityWorld().getEntitiesWithinAABBExcludingEntity(this, getEntityBoundingBox().grow(10D, 10D, 10D));
for (int i = 0; i < list.size(); i++) {
Entity entity = list.get(i);
if (entity != null) {
if (!(entity instanceof EntityCreature))
continue;
for (int j = 0; j < preys.length; j++)
if (entity.getClass() == preys[j] && !entity.isBeingRidden())
return canEntityBeSeen(entity) ? entity : null;
}
}
return null;
}
代码示例来源:origin: vadis365/TheErebus
@Override
public boolean attackEntityAsMob(Entity entity) {
if (super.attackEntityAsMob(entity)) {
if (entity instanceof EntityPlayer)
if (rand.nextInt(20) == 0 && !entity.isBeingRidden()) {
EntityBotFlyLarva entityBotFlyLarva = new EntityBotFlyLarva(getEntityWorld());
entityBotFlyLarva.setPosition(entity.posX, entity.posY + 1, entity.posZ);
entityBotFlyLarva.setParasiteCount((byte) 1);
entityBotFlyLarva.startRiding(entity, true);
getEntityWorld().spawnEntity(entityBotFlyLarva);
} else if (rand.nextInt(20) == 0 && getParasite((EntityPlayer) entity) != null)
if (((EntityBotFlyLarva) getParasite((EntityPlayer) entity)).getParasiteCount() < 3)
((EntityBotFlyLarva) getParasite((EntityPlayer) entity)).setParasiteCount((byte) (((EntityBotFlyLarva) getParasite((EntityPlayer) entity)).getParasiteCount() + 1));
return true;
}
return false;
}
代码示例来源: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);
}
代码示例来源:origin: CoFH/ThermalDynamics
@Override
public void doRender(Entity entity, double x, double y, double z, float entityYaw, float partialTicks) {
if (!entity.isBeingRidden()) {
return;
内容来源于网络,如有侵权,请联系作者删除!