Package net.minecraft.util

Examples of net.minecraft.util.AxisAlignedBB


      if (maxXP <= 0) {
        par1ItemStack.setItemDamage(0);
        return; // Can't take any XP.
      }

      AxisAlignedBB boundingBox = AxisAlignedBB.getBoundingBox(player.posX - r, player.posY - r, player.posZ - r, player.posX + r, player.posY + r, player.posZ + r);
      List<EntityXPOrb> orbs = par2World.getEntitiesWithinAABB(EntityXPOrb.class, boundingBox);

      for (EntityXPOrb orb : orbs) {
        if (!orb.isDead) {
          int xp = orb.getXpValue();
View Full Code Here


    findEntities(coords);
    return !worldObj.isAirBlock(coords.posX, coords.posY, coords.posZ) || !detectedEntities.isEmpty();
  }

  public void findEntities(ChunkCoordinates coords) {
    AxisAlignedBB boundingBox = AxisAlignedBB.getBoundingBox(coords.posX, coords.posY, coords.posZ, coords.posX + 1, coords.posY + 1, coords.posZ + 1);
    detectedEntities = worldObj.getEntitiesWithinAABB(Entity.class, boundingBox);
  }
View Full Code Here

      boolean blue = (getBlockMetadata() & 1) == 0;
      int speedMod = blue ? 1 : -1;
      double range = redstone / 2;

      AxisAlignedBB boundingBox = AxisAlignedBB.getBoundingBox(x1 - range, yCoord, z1 - range, x1 + range, y1 + range, z1 + range);
      List<Entity> entities = worldObj.selectEntitiesWithinAABB(Entity.class, boundingBox, getEntitySelector());

      for (Entity entity : entities) {
        double x2 = entity.posX;
        double y2 = entity.posY;
View Full Code Here

  public static Vector3d getEntityPosition(Entity ent) {
    return new Vector3d(ent.posX, ent.posY, ent.posZ);
  }
 
  public static List<AxisAlignedBB> getCollidingBlockGeometry(World world, Entity entity) {
    AxisAlignedBB entityBounds = entity.boundingBox;
    ArrayList collidingBoundingBoxes = new ArrayList();
    int minX = MathHelper.floor_double(entityBounds.minX);
    int minY = MathHelper.floor_double(entityBounds.minY);
    int minZ = MathHelper.floor_double(entityBounds.minZ);
    int maxX = MathHelper.floor_double(entityBounds.maxX + 1.0D);   
View Full Code Here

    return null;
  }
 
  private void doHoover(EntityPlayer player) {
   
    AxisAlignedBB aabb = AxisAlignedBB.getBoundingBox(
        player.posX - Config.magnetRange, player.posY - Config.magnetRange, player.posZ - Config.magnetRange,
        player.posX + Config.magnetRange, player.posY + Config.magnetRange, player.posZ + Config.magnetRange);
       
    List<Entity> interestingItems = player.worldObj.selectEntitiesWithinAABB(EntityItem.class, aabb, this);       
    List<Entity> xp = player.worldObj.selectEntitiesWithinAABB(EntityXPOrb.class, aabb, this);
View Full Code Here

    Block block = w.getBlock(bc.x, bc.y, bc.z);
    if(block == null || block.isAir(w, bc.x, bc.y, bc.z)) {
      return true;
    }   
    final AxisAlignedBB aabb = block.getCollisionBoundingBoxFromPool(w, bc.x, bc.y, bc.z);
    return aabb == null || aabb.getAverageEdgeLength() < 0.7;
  }
View Full Code Here

  private boolean isClear(World w, Block block, int x, int y, int z) {
    if(block == null || block.isAir(w, x, y, z)) {
      return true;
    }
    final AxisAlignedBB aabb = block.getCollisionBoundingBoxFromPool(w, x, y, z);
    if(aabb == null || aabb.getAverageEdgeLength() < 0.7) {
      return true;
    }

    return block.getLightOpacity(w, x, y, z) < 2;
  }
View Full Code Here

  }

  protected void moveEntities()
  {
    VectorWorld targetLocation = this.getTargetPosition();
    AxisAlignedBB axisalignedbb = this.getSearchAxisAlignedBB();

    if (axisalignedbb != null)
    {
      List<Entity> entities = this.worldObj.getEntitiesWithinAABBExcludingEntity(null, axisalignedbb);
View Full Code Here

  {
    try
    {
      IBiometricIdentifier biometricIdentifier = this.getBiometricIdentifier();

      AxisAlignedBB emptyBounds = AxisAlignedBB.getBoundingBox(this.xCoord, this.yCoord, this.zCoord, this.xCoord + 1, this.yCoord + 1, this.zCoord + 1);

      List<EntityLivingBase> warningList = this.worldObj.getEntitiesWithinAABB(EntityLivingBase.class, emptyBounds.expand(getWarningRange(), getWarningRange(), getWarningRange()));
      List<EntityLivingBase> actionList = this.worldObj.getEntitiesWithinAABB(EntityLivingBase.class, emptyBounds.expand(getActionRange(), getActionRange(), getActionRange()));

      for (EntityLivingBase entityLiving : warningList)
      {
        if (entityLiving instanceof EntityPlayer && !actionList.contains(entityLiving))
        {
View Full Code Here

  }

  static boolean canPlaceBlockOnRightClick(EntityPlayer player, World world, int x, int y, int z, int side, int slot) {
    BlockCoord placeCoord = new BlockCoord(x, y, z).getLocation(ForgeDirection.getOrientation(side));
    ItemStack toUse = player.inventory.mainInventory[slot];
    AxisAlignedBB aabb;
    Block blk = Block.getBlockFromItem(toUse.getItem());
    if(blk != null) {
      aabb = blk.getCollisionBoundingBoxFromPool(world, placeCoord.x, placeCoord.y, placeCoord.z);
    } else {
      BoundingBox bb = new BoundingBox(placeCoord);
      aabb = bb.getAxisAlignedBB();
    }     
    if(aabb != null && aabb.intersectsWith(player.boundingBox)) {
      return false;
    }
    return true;
  }
View Full Code Here

TOP

Related Classes of net.minecraft.util.AxisAlignedBB

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.