net.minecraft.world.World.getEntitiesWithinAABBExcludingEntity()方法的使用及代码示例

x33g5p2x  于2022-02-02 转载在 其他  
字(7.0k)|赞(0)|评价(0)|浏览(95)

本文整理了Java中net.minecraft.world.World.getEntitiesWithinAABBExcludingEntity()方法的一些代码示例,展示了World.getEntitiesWithinAABBExcludingEntity()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。World.getEntitiesWithinAABBExcludingEntity()方法的具体详情如下:
包路径:net.minecraft.world.World
类名称:World
方法名:getEntitiesWithinAABBExcludingEntity

World.getEntitiesWithinAABBExcludingEntity介绍

暂无

代码示例

代码示例来源:origin: AppliedEnergistics/Applied-Energistics-2

protected List<Entity> getCheckedEntitiesWithinAABBExcludingEntity( final AxisAlignedBB region )
  {
    return this.world.getEntitiesWithinAABBExcludingEntity( this, region );
  }
}

代码示例来源:origin: Vazkii/Quark

@Override
protected List<Entity> getValidEntities(World world, AxisAlignedBB aabb) {
  return world.getEntitiesWithinAABBExcludingEntity(null, aabb);
}

代码示例来源:origin: AppliedEnergistics/Applied-Energistics-2

if( hitEntities )
  final List list = w.getEntitiesWithinAABBExcludingEntity( p, bb );

代码示例来源:origin: Vazkii/Botania

while(entities.size() == 0 && distance < 25) {
  target = target.add(new Vector3(player.getLookVec()).multiply(distance)).add(0, 0.5, 0);
  entities = player.world.getEntitiesWithinAABBExcludingEntity(player, new AxisAlignedBB(target.x - RANGE, target.y - RANGE, target.z - RANGE, target.x + RANGE, target.y + RANGE, target.z + RANGE));
  distance++;
  if(entities.contains(taritem))
while(entities.size() == 0 && distance < 25) {
  target = target.add(new Vector3(player.getLookVec()).multiply(distance)).add(0, 0.5, 0);
  entities = player.world.getEntitiesWithinAABBExcludingEntity(player, new AxisAlignedBB(target.x - RANGE, target.y - RANGE, target.z - RANGE, target.x + RANGE, target.y + RANGE, target.z + RANGE));
  distance++;

代码示例来源:origin: AppliedEnergistics/Applied-Energistics-2

final List list = w.getEntitiesWithinAABBExcludingEntity( p, bb );
double closest = 9999999.0D;

代码示例来源:origin: SleepyTrousers/EnderIO

@Override
public @Nonnull List<Entity> getEntitiesWithinAABBExcludingEntity(@Nullable Entity entityIn, @Nonnull AxisAlignedBB bb) {
 return wrapped.getEntitiesWithinAABBExcludingEntity(entityIn, bb);
}

代码示例来源:origin: Vazkii/Botania

while(entities.size() == 0 && distance < 25) {
  target = target.add(new Vector3(player.getLookVec()).multiply(distance)).add(0, 0.5, 0);
  entities = player.world.getEntitiesWithinAABBExcludingEntity(player, new AxisAlignedBB(target.x - RANGE, target.y - RANGE, target.z - RANGE, target.x + RANGE, target.y + RANGE, target.z + RANGE));
  distance++;
  if(entities.contains(taritem))

代码示例来源:origin: AppliedEnergistics/Applied-Energistics-2

final List<Entity> list = this.world.getEntitiesWithinAABBExcludingEntity( this, area );

代码示例来源:origin: AppliedEnergistics/Applied-Energistics-2

final List list = w.getEntitiesWithinAABBExcludingEntity( p, bb );
double closest = 9999999.0D;

代码示例来源:origin: amadornes/MCMultiPart

@Override
public List<Entity> getEntitiesWithinAABBExcludingEntity(Entity entityIn, AxisAlignedBB bb) {
  return getActualWorld().getEntitiesWithinAABBExcludingEntity(entityIn, bb);
}

代码示例来源:origin: Vazkii/Botania

List<Entity> list = this.world.getEntitiesWithinAABBExcludingEntity(this, this.getEntityBoundingBox().expand(this.motionX, this.motionY, this.motionZ).grow(1.0D));
double d0 = 0.0D;
boolean flag = false;

代码示例来源:origin: Vazkii/Botania

List<Entity> list = world.getEntitiesWithinAABBExcludingEntity(this, getEntityBoundingBox().offset(motionX, motionY, motionZ).grow(1.0D));
double d0 = 0.0D;
for (int i = 0; i < list.size(); ++i)

代码示例来源:origin: iLexiconn/LLibrary

public void collideWithNearbyEntities() {
  List<Entity> entities = this.world.getEntitiesWithinAABBExcludingEntity(this, this.getEntityBoundingBox().expand(0.20000000298023224D, 0.0D, 0.20000000298023224D));
  entities.stream().filter(entity -> entity != this.parent && !(entity instanceof PartEntity) && entity.canBePushed()).forEach(entity -> entity.applyEntityCollision(this.parent));
}

代码示例来源:origin: JurassiCraftTeam/JurassiCraft2

private boolean canFit(BlockPos pos) {
  double x = pos.getX() + 0.5;
  double y = pos.getY();
  double z = pos.getZ() + 0.5;
  AxisAlignedBB boundingBox = new AxisAlignedBB(x, y, z, x + this.dinosaur.width, y + this.dinosaur.height, z + this.dinosaur.width);
  return this.dinosaur.world.getCollisionBoxes(this.dinosaur, boundingBox).isEmpty() && this.dinosaur.world.getEntitiesWithinAABBExcludingEntity(this.dinosaur, boundingBox).isEmpty();
}

代码示例来源:origin: SleepyTrousers/EnderIO

@Override
public void onUserHurt(@Nonnull EntityLivingBase user, @Nonnull Entity attacker, int level) {
 if (user instanceof EntityPlayer && attacker instanceof EntityLivingBase && !EnchantmentHelper.getEnchantedItem(this, user).isEmpty()) {
  if (level > getMaxLevel()) {
   for (Entity e : user.world.getEntitiesWithinAABBExcludingEntity(user, user.getEntityBoundingBox().expand(level * 8, level * 4, level * 8))) {
    RandomTeleportUtil.teleportEntity(e.world, e, false, false, 16 * level);
   }
  } else if (user.getRNG().nextFloat() < (.5f + .1f * level)) {
   RandomTeleportUtil.teleportEntity(attacker.world, attacker, false, attacker instanceof EntityPlayer || user.getRNG().nextFloat() < .75f, 16 * level);
  }
 }
}

代码示例来源:origin: TerraFirmaCraft/TerraFirmaCraft

public void turnToDirt(World world, BlockPos pos)
{
  world.setBlockState(pos, get(rock, Rock.Type.DIRT).getDefaultState());
  AxisAlignedBB axisalignedbb = FLIPPED_AABB.offset(pos);
  for (Entity entity : world.getEntitiesWithinAABBExcludingEntity(null, axisalignedbb))
  {
    double d0 = Math.min(axisalignedbb.maxY - axisalignedbb.minY, axisalignedbb.maxY - entity.getEntityBoundingBox().minY);
    entity.setPositionAndUpdate(entity.posX, entity.posY + d0 + 0.001D, entity.posZ);
  }
}

代码示例来源:origin: Alex-the-666/Ice_and_Fire

public void triggerOtherSirens(EntityLivingBase aggressor) {
  List<Entity> entities = world.getEntitiesWithinAABBExcludingEntity(this, this.getEntityBoundingBox().grow(12, 12, 12));
  for (Entity entity : entities) {
    if (entity instanceof EntitySiren) {
      ((EntitySiren) entity).setAttackTarget(aggressor);
      ((EntitySiren) entity).setAggressive(true);
      ((EntitySiren) entity).setSinging(false);
    }
  }
}

代码示例来源:origin: Vazkii/Botania

List<Entity> list = world.getEntitiesWithinAABBExcludingEntity(this, getEntityBoundingBox().offset(motionX*2, motionY*2, motionZ*2).grow(2));
double d0 = 0.0D;

代码示例来源:origin: TeamLapen/Vampirism

@Override
public void execute(MinecraftServer server, ICommandSender sender, String[] args) throws CommandException {
  EntityPlayer player = getCommandSenderAsPlayer(sender);
  List l = player.getEntityWorld().getEntitiesWithinAABBExcludingEntity(player, player.getEntityBoundingBox().grow(3, 2, 3));
  for (Object o : l) {
    if (o instanceof EntityCreature) {
      ResourceLocation id = EntityList.getKey((Entity) o);
      sender.sendMessage(new TextComponentString(id.toString()));
    } else {
      sender.sendMessage(new TextComponentString("Not biteable " + o.getClass().getName()));
    }
  }
}

代码示例来源:origin: TeamLapen/Vampirism

@Override
public void execute(MinecraftServer server, ICommandSender sender, String[] args) throws CommandException {
  EntityPlayer player = getCommandSenderAsPlayer(sender);
  List<Entity> l = player.getEntityWorld().getEntitiesWithinAABBExcludingEntity(player, player.getEntityBoundingBox().grow(3, 2, 3));
  for (Entity o : l) {
    NBTTagCompound nbt = new NBTTagCompound();
    o.writeToNBT(nbt);
    VampirismMod.log.i("InfoEntity", "Data %s", nbt);
  }
  sender.sendMessage(new TextComponentString("Printed info to log"));
}

相关文章

微信公众号

最新文章

更多

World类方法