Package net.minecraft.util

Examples of net.minecraft.util.AxisAlignedBB


    if (storedData.getInteger(indexExplosionTimer) > 0) {
      progressExplosion(storedData, world, housing.getXCoord(), housing.getYCoord(), housing.getZCoord());
      return storedData;
    }

    AxisAlignedBB infectionBox = getBounding(genome, housing, 1.0f);

    @SuppressWarnings("rawtypes")
    List list = world.getEntitiesWithinAABB(EntityPlayer.class, infectionBox);

    for (Object obj : list) {
View Full Code Here


      return AxisAlignedBB.getBoundingBox((double) x + 0, (double) y + 0, (double) z + 0, (double) x + 1, (double) y + 1, (double) z + 1);
    }
    RaytraceResult rayTraceResult = doRayTrace(world, x, y, z, Minecraft.getMinecraft().thePlayer);

    if (rayTraceResult != null && rayTraceResult.boundingBox != null) {
      AxisAlignedBB box = rayTraceResult.boundingBox;
      switch (rayTraceResult.hitPart) {
      case Gate:
      case Plug:
      case RobotStation: {
        float scale = 0.001F;
        box = box.expand(scale, scale, scale);
        break;
      }
      case Pipe: {
        float scale = 0.08F;
        box = box.expand(scale, scale, scale);
        break;
      }
      case Facade:
        break;
      }
      return box.getOffsetBoundingBox(x, y, z);
    }
    return super.getSelectedBoundingBoxFromPool(world, x, y, z).expand(-0.85F, -0.85F, -0.85F);
  }
View Full Code Here

    // pipe

    for (ForgeDirection side : DIR_VALUES) {
      if (side == ForgeDirection.UNKNOWN || tileG.isPipeConnected(side)) {
        AxisAlignedBB bb = getPipeBoundingBox(side);
        setBlockBounds(bb);
        boxes[side.ordinal()] = bb;
        hits[side.ordinal()] = super.collisionRayTrace(world, x, y, z, origin, direction);
        sideHit[side.ordinal()] = side;
      }
    }

    // gates

    for (ForgeDirection side : ForgeDirection.VALID_DIRECTIONS) {
      if (pipe.hasGate(side)) {
        AxisAlignedBB bb = getGateBoundingBox(side);
        setBlockBounds(bb);
        boxes[7 + side.ordinal()] = bb;
        hits[7 + side.ordinal()] = super.collisionRayTrace(world, x, y, z, origin, direction);
        sideHit[7 + side.ordinal()] = side;
      }
    }

    // facades

    for (ForgeDirection side : ForgeDirection.VALID_DIRECTIONS) {
      if (tileG.tilePart.hasFacade(side)) {
        AxisAlignedBB bb = getFacadeBoundingBox(side);
        setBlockBounds(bb);
        boxes[13 + side.ordinal()] = bb;
        hits[13 + side.ordinal()] = super.collisionRayTrace(world, x, y, z, origin, direction);
        sideHit[13 + side.ordinal()] = side;
      }
    }

    // plugs

    for (ForgeDirection side : ForgeDirection.VALID_DIRECTIONS) {
      if (tileG.tilePart.hasPlug(side)) {
        AxisAlignedBB bb = getPlugBoundingBox(side);
        setBlockBounds(bb);
        boxes[19 + side.ordinal()] = bb;
        hits[19 + side.ordinal()] = super.collisionRayTrace(world, x, y, z, origin, direction);
        sideHit[19 + side.ordinal()] = side;
      }
    }

    // robotStations

    for (ForgeDirection side : ForgeDirection.VALID_DIRECTIONS) {
      if (tileG.tilePart.hasRobotStation(side)) {
        AxisAlignedBB bb = getRobotStationBoundingBox(side);
        setBlockBounds(bb);
        boxes[25 + side.ordinal()] = bb;
        hits[25 + side.ordinal()] = super.collisionRayTrace(world, x, y, z, origin, direction);
        sideHit[25 + side.ordinal()] = side;
      }
View Full Code Here

  }

  @Override
  public Cuboid6 getBounds()
  {
    AxisAlignedBB b = null;

    for (AxisAlignedBB bx : cb.getSelectedBoundingBoxesFromPool( false, true, null, true ))
    {
      if ( b == null )
        b = bx;
      else
      {
        double minX = Math.min( b.minX, bx.minX );
        double minY = Math.min( b.minY, bx.minY );
        double minZ = Math.min( b.minZ, bx.minZ );
        double maxX = Math.max( b.maxX, bx.maxX );
        double maxY = Math.max( b.maxY, bx.maxY );
        double maxZ = Math.max( b.maxZ, bx.maxZ );
        b.setBounds( minX, minY, minZ, maxX, maxY, maxZ );
      }
    }

    if ( b == null )
      return new Cuboid6( 0.0, 0.0, 0.0, 1.0, 1.0, 1.0 );
View Full Code Here

        if ( fPart != null )
          fPart.getBoxes( bch );
      }

      AxisAlignedBB b = null;
      AxisAlignedBB pb = Platform.getPrimaryBox( dir, 2 );

      for (AxisAlignedBB bb : boxes)
      {
        if ( bb.intersectsWith( pb ) )
        {
View Full Code Here

      return;

    ItemStack item = getEntityItem();
    if ( AEApi.instance().materials().materialSingularity.sameAsStack( item ) )
    {
      AxisAlignedBB region = AxisAlignedBB.getBoundingBox( posX - 4, posY - 4, posZ - 4, posX + 4, posY + 4, posZ + 4 );
      List<Entity> l = worldObj.getEntitiesWithinAABBExcludingEntity( this, region );

      for (Entity e : l)
      {
        if ( e instanceof EntityItem )
View Full Code Here

  public boolean transform()
  {
    ItemStack item = getEntityItem();
    if ( AEApi.instance().materials().materialCertusQuartzCrystalCharged.sameAsStack( item ) )
    {
      AxisAlignedBB region = AxisAlignedBB.getBoundingBox( posX - 1, posY - 1, posZ - 1, posX + 1, posY + 1, posZ + 1 );
      List<Entity> l = worldObj.getEntitiesWithinAABBExcludingEntity( this, region );

      EntityItem redstone = null;
      EntityItem netherQuartz = null;
View Full Code Here

    if ( tile != null )
    {
      double twoPixels = 2.0 / 16.0;
      ForgeDirection up = tile.getUp();
      ForgeDirection forward = tile.getForward();
      AxisAlignedBB bb = AxisAlignedBB.getBoundingBox( twoPixels, twoPixels, twoPixels, 1.0 - twoPixels, 1.0 - twoPixels, 1.0 - twoPixels );

      if ( up.offsetX != 0 )
      {
        bb.minX = 0;
        bb.maxX = 1;
View Full Code Here

  {
    BlockMatrixFrame blkMF = (BlockMatrixFrame) AEApi.instance().blocks().blockMatrixFrame.block();

    transverseEdges( i - 1, j - 1, k - 1, i + scaleX + 1, j + scaleY + 1, k + scaleZ + 1, new WrapInMatrixFrame( blkMF, 0, dst ) );

    AxisAlignedBB srcBox = AxisAlignedBB.getBoundingBox( x, y, z, x + scaleX + 1, y + scaleY + 1, z + scaleZ + 1 );

    AxisAlignedBB dstBox = AxisAlignedBB.getBoundingBox( i, j, k, i + scaleX + 1, j + scaleY + 1, k + scaleZ + 1 );

    CachedPlane cDst = new CachedPlane( dst, i, j, k, i + scaleX, j + scaleY, k + scaleZ );
    CachedPlane cSrc = new CachedPlane( src, x, y, z, x + scaleX, y + scaleY, z + scaleZ );

    // do nearly all the work... swaps blocks, tiles, and block ticks
View Full Code Here

    float f8 = f3 * f5;
    double d3 = 32.0D;

    Vec3 vec31 = vec3.addVector( f7 * d3, f6 * d3, f8 * d3 );

    AxisAlignedBB bb = AxisAlignedBB.getBoundingBox( Math.min( vec3.xCoord, vec31.xCoord ), Math.min( vec3.yCoord, vec31.yCoord ),
        Math.min( vec3.zCoord, vec31.zCoord ), Math.max( vec3.xCoord, vec31.xCoord ), Math.max( vec3.yCoord, vec31.yCoord ),
        Math.max( vec3.zCoord, vec31.zCoord ) ).expand( 16, 16, 16 );

    Entity entity = null;
    double closest = 9999999.0D;
    if ( hitEntities )
    {
      List list = w.getEntitiesWithinAABBExcludingEntity( p, bb );
      int l;

      for (l = 0; l < list.size(); ++l)
      {
        Entity entity1 = (Entity) list.get( l );

        if ( !entity1.isDead && entity1 != p && !(entity1 instanceof EntityItem) )
        {
          if ( entity1.isEntityAlive() )
          {
            // prevent killing / flying of mounts.
            if ( entity1.riddenByEntity == p )
              continue;

            f1 = 0.3F;
            AxisAlignedBB boundingBox = entity1.boundingBox.expand( f1, f1, f1 );
            MovingObjectPosition movingObjectPosition = boundingBox.calculateIntercept( vec3, vec31 );

            if ( movingObjectPosition != null )
            {
              double nd = vec3.squareDistanceTo( movingObjectPosition.hitVec );

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.