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

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

本文整理了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

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

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

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

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

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

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

  1. while(entities.size() == 0 && distance < 25) {
  2. target = target.add(new Vector3(player.getLookVec()).multiply(distance)).add(0, 0.5, 0);
  3. 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));
  4. distance++;
  5. if(entities.contains(taritem))
  6. while(entities.size() == 0 && distance < 25) {
  7. target = target.add(new Vector3(player.getLookVec()).multiply(distance)).add(0, 0.5, 0);
  8. 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));
  9. distance++;

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

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

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

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

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

  1. while(entities.size() == 0 && distance < 25) {
  2. target = target.add(new Vector3(player.getLookVec()).multiply(distance)).add(0, 0.5, 0);
  3. 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));
  4. distance++;
  5. if(entities.contains(taritem))

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

  1. public void triggerOtherSirens(EntityLivingBase aggressor) {
  2. List<Entity> entities = world.getEntitiesWithinAABBExcludingEntity(this, this.getEntityBoundingBox().grow(12, 12, 12));
  3. for (Entity entity : entities) {
  4. if (entity instanceof EntitySiren) {
  5. ((EntitySiren) entity).setAttackTarget(aggressor);
  6. ((EntitySiren) entity).setAggressive(true);
  7. ((EntitySiren) entity).setSinging(false);
  8. }
  9. }
  10. }

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

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

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

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

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

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

相关文章

World类方法