Package net.minecraft.util

Examples of net.minecraft.util.AxisAlignedBB


            }
    }

    @SuppressWarnings("unchecked")
    public List<EntityLivingBase> getEntitiesInSteamArea() {
        AxisAlignedBB area = AxisAlignedBB.getBoundingBox(-0.5D, -0.5D, -0.5D, 0.5D, 0.5D, 0.5D);
        MiscTools.addCoordToAABB(area, direction.offsetX * RANGE, direction.offsetY * RANGE, direction.offsetZ * RANGE);
        area.offset(xCoord + 0.5, yCoord + 0.5, zCoord + 0.5);
        List<EntityLivingBase> entities = (List<EntityLivingBase>) worldObj.getEntitiesWithinAABB(EntityLivingBase.class, area);
        return entities;
    }
View Full Code Here


    @Override
    public void onMinecartPass(EntityMinecart cart) {
        if (powered && cart.canBeRidden() && cart.riddenByEntity == null && cart.getEntityData().getInteger("MountPrevention") <= 0) {
            int a = area;
            AxisAlignedBB box = AxisAlignedBB.getBoundingBox(getX(), getY(), getZ(), getX() + 1, getY() + 1, getZ() + 1);
            box = box.expand(a, a, a);
            List entities = getWorld().getEntitiesWithinAABB(EntityLivingBase.class, box);

            if (entities.size() > 0) {
                EntityLivingBase entity = (EntityLivingBase) entities.get(MiscTools.getRand().nextInt(entities.size()));
View Full Code Here

    }

    private boolean isRoutedCartApproaching(ITrackSwitch track) {
        if (logic == null || !logic.isValid())
            return false;
        AxisAlignedBB searchBox = track.getRoutingSearchBox();
        List<EntityMinecart> carts = CartUtils.getMinecartsIn(worldObj, searchBox);
        for (EntityMinecart cart : carts) {
            if (logic.matches(this, cart))
                return true;
        }
View Full Code Here

                        return MultiBlockStateReturn.PATTERN_DOES_NOT_MATCH;
                }
            }
        }

        AxisAlignedBB entityCheckBounds = map.getEntityCheckBounds(xCoord, yCoord, zCoord);
//                if(entityCheckBounds != null) {
//                    System.out.println("test entitys: " + entityCheckBounds.toString());
//                }
        if (entityCheckBounds != null && !worldObj.getEntitiesWithinAABB(EntityLivingBase.class, entityCheckBounds).isEmpty())
            return MultiBlockStateReturn.ENTITY_IN_WAY;
View Full Code Here

            {'O', 'O', 'O', 'O', 'O'}
        };

        for (int i = 4; i <= 8; i++) {
            char[][][] map = buildMap(i, bottom, middle, top, border);
            AxisAlignedBB entityCheck = AxisAlignedBB.getBoundingBox(0, 1, 0, 1, i - 1, 1);
            pats.add(buildPattern(map, xOffset, yOffset, zOffset, entityCheck));
        }

        // 5x5
        if (client || RailcraftConfig.getMaxTankSize() >= 5) {
            xOffset = zOffset = 3;

            bottom = new char[][]{
                {'O', 'O', 'O', 'O', 'O', 'O', 'O'},
                {'O', 'B', 'B', 'B', 'B', 'B', 'O'},
                {'O', 'B', 'W', 'W', 'W', 'B', 'O'},
                {'O', 'B', 'W', 'M', 'W', 'B', 'O'},
                {'O', 'B', 'W', 'W', 'W', 'B', 'O'},
                {'O', 'B', 'B', 'B', 'B', 'B', 'O'},
                {'O', 'O', 'O', 'O', 'O', 'O', 'O'}
            };

            middle = new char[][]{
                {'O', 'O', 'O', 'O', 'O', 'O', 'O'},
                {'O', 'B', 'W', 'W', 'W', 'B', 'O'},
                {'O', 'W', 'A', 'A', 'A', 'W', 'O'},
                {'O', 'W', 'A', 'A', 'A', 'W', 'O'},
                {'O', 'W', 'A', 'A', 'A', 'W', 'O'},
                {'O', 'B', 'W', 'W', 'W', 'B', 'O'},
                {'O', 'O', 'O', 'O', 'O', 'O', 'O'}
            };

            top = new char[][]{
                {'O', 'O', 'O', 'O', 'O', 'O', 'O'},
                {'O', 'B', 'B', 'B', 'B', 'B', 'O'},
                {'O', 'B', 'W', 'W', 'W', 'B', 'O'},
                {'O', 'B', 'W', 'T', 'W', 'B', 'O'},
                {'O', 'B', 'W', 'W', 'W', 'B', 'O'},
                {'O', 'B', 'B', 'B', 'B', 'B', 'O'},
                {'O', 'O', 'O', 'O', 'O', 'O', 'O'}
            };

            border = new char[][]{
                {'O', 'O', 'O', 'O', 'O', 'O', 'O'},
                {'O', 'O', 'O', 'O', 'O', 'O', 'O'},
                {'O', 'O', 'O', 'O', 'O', 'O', 'O'},
                {'O', 'O', 'O', 'O', 'O', 'O', 'O'},
                {'O', 'O', 'O', 'O', 'O', 'O', 'O'},
                {'O', 'O', 'O', 'O', 'O', 'O', 'O'},
                {'O', 'O', 'O', 'O', 'O', 'O', 'O'}
            };

            for (int i = 4; i <= 8; i++) {
                char[][][] map = buildMap(i, bottom, middle, top, border);
                AxisAlignedBB entityCheck = AxisAlignedBB.getBoundingBox(-1, 1, -1, 2, i - 1, 2);
                pats.add(buildPattern(map, xOffset, yOffset, zOffset, entityCheck));
            }
        }


        // 7x7
        if (client || RailcraftConfig.getMaxTankSize() >= 7) {
            xOffset = zOffset = 4;

            bottom = new char[][]{
                {'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O'},
                {'O', 'B', 'B', 'B', 'B', 'B', 'B', 'B', 'O'},
                {'O', 'B', 'W', 'W', 'W', 'W', 'W', 'B', 'O'},
                {'O', 'B', 'W', 'W', 'W', 'W', 'W', 'B', 'O'},
                {'O', 'B', 'W', 'W', 'M', 'W', 'W', 'B', 'O'},
                {'O', 'B', 'W', 'W', 'W', 'W', 'W', 'B', 'O'},
                {'O', 'B', 'W', 'W', 'W', 'W', 'W', 'B', 'O'},
                {'O', 'B', 'B', 'B', 'B', 'B', 'B', 'B', 'O'},
                {'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O'}
            };

            middle = new char[][]{
                {'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O'},
                {'O', 'B', 'W', 'W', 'W', 'W', 'W', 'B', 'O'},
                {'O', 'W', 'A', 'A', 'A', 'A', 'A', 'W', 'O'},
                {'O', 'W', 'A', 'A', 'A', 'A', 'A', 'W', 'O'},
                {'O', 'W', 'A', 'A', 'A', 'A', 'A', 'W', 'O'},
                {'O', 'W', 'A', 'A', 'A', 'A', 'A', 'W', 'O'},
                {'O', 'W', 'A', 'A', 'A', 'A', 'A', 'W', 'O'},
                {'O', 'B', 'W', 'W', 'W', 'W', 'W', 'B', 'O'},
                {'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O'}
            };

            top = new char[][]{
                {'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O'},
                {'O', 'B', 'B', 'B', 'B', 'B', 'B', 'B', 'O'},
                {'O', 'B', 'W', 'W', 'W', 'W', 'W', 'B', 'O'},
                {'O', 'B', 'W', 'W', 'W', 'W', 'W', 'B', 'O'},
                {'O', 'B', 'W', 'W', 'T', 'W', 'W', 'B', 'O'},
                {'O', 'B', 'W', 'W', 'W', 'W', 'W', 'B', 'O'},
                {'O', 'B', 'W', 'W', 'W', 'W', 'W', 'B', 'O'},
                {'O', 'B', 'B', 'B', 'B', 'B', 'B', 'B', 'O'},
                {'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O'}
            };

            border = new char[][]{
                {'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O'},
                {'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O'},
                {'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O'},
                {'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O'},
                {'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O'},
                {'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O'},
                {'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O'},
                {'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O'},
                {'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O'}
            };

            for (int i = 4; i <= 8; i++) {
                char[][][] map = buildMap(i, bottom, middle, top, border);
                AxisAlignedBB entityCheck = AxisAlignedBB.getBoundingBox(-2, 1, -2, 3, i - 1, 3);
                pats.add(buildPattern(map, xOffset, yOffset, zOffset, entityCheck));
            }
        }

        // 9x9
        if (client || RailcraftConfig.getMaxTankSize() >= 9) {
            xOffset = zOffset = 5;

            bottom = new char[][]{
                {'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O'},
                {'O', 'B', 'B', 'B', 'B', 'B', 'B', 'B', 'B', 'B', 'O'},
                {'O', 'B', 'W', 'W', 'W', 'W', 'W', 'W', 'W', 'B', 'O'},
                {'O', 'B', 'W', 'W', 'W', 'W', 'W', 'W', 'W', 'B', 'O'},
                {'O', 'B', 'W', 'W', 'W', 'W', 'W', 'W', 'W', 'B', 'O'},
                {'O', 'B', 'W', 'W', 'W', 'M', 'W', 'W', 'W', 'B', 'O'},
                {'O', 'B', 'W', 'W', 'W', 'W', 'W', 'W', 'W', 'B', 'O'},
                {'O', 'B', 'W', 'W', 'W', 'W', 'W', 'W', 'W', 'B', 'O'},
                {'O', 'B', 'W', 'W', 'W', 'W', 'W', 'W', 'W', 'B', 'O'},
                {'O', 'B', 'B', 'B', 'B', 'B', 'B', 'B', 'B', 'B', 'O'},
                {'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O'}
            };

            middle = new char[][]{
                {'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O'},
                {'O', 'B', 'W', 'W', 'W', 'W', 'W', 'W', 'W', 'B', 'O'},
                {'O', 'W', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'W', 'O'},
                {'O', 'W', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'W', 'O'},
                {'O', 'W', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'W', 'O'},
                {'O', 'W', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'W', 'O'},
                {'O', 'W', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'W', 'O'},
                {'O', 'W', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'W', 'O'},
                {'O', 'W', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'W', 'O'},
                {'O', 'B', 'W', 'W', 'W', 'W', 'W', 'W', 'W', 'B', 'O'},
                {'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O'}
            };

            top = new char[][]{
                {'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O'},
                {'O', 'B', 'B', 'B', 'B', 'B', 'B', 'B', 'B', 'B', 'O'},
                {'O', 'B', 'W', 'W', 'W', 'W', 'W', 'W', 'W', 'B', 'O'},
                {'O', 'B', 'W', 'W', 'W', 'W', 'W', 'W', 'W', 'B', 'O'},
                {'O', 'B', 'W', 'W', 'W', 'W', 'W', 'W', 'W', 'B', 'O'},
                {'O', 'B', 'W', 'W', 'W', 'T', 'W', 'W', 'W', 'B', 'O'},
                {'O', 'B', 'W', 'W', 'W', 'W', 'W', 'W', 'W', 'B', 'O'},
                {'O', 'B', 'W', 'W', 'W', 'W', 'W', 'W', 'W', 'B', 'O'},
                {'O', 'B', 'W', 'W', 'W', 'W', 'W', 'W', 'W', 'B', 'O'},
                {'O', 'B', 'B', 'B', 'B', 'B', 'B', 'B', 'B', 'B', 'O'},
                {'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O'}
            };

            border = new char[][]{
                {'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O'},
                {'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O'},
                {'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O'},
                {'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O'},
                {'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O'},
                {'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O'},
                {'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O'},
                {'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O'},
                {'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O'},
                {'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O'},
                {'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O'}
            };

            for (int i = 4; i <= 8; i++) {
                char[][][] map = buildMap(i, bottom, middle, top, border);
                AxisAlignedBB entityCheck = AxisAlignedBB.getBoundingBox(-3, 1, -3, 4, i - 1, 4);
                pats.add(buildPattern(map, xOffset, yOffset, zOffset, entityCheck));
            }
        }

        return pats;
View Full Code Here

        feedTime--;
        if (!powered && feed != null && feed.stackSize > 0 && feedTime <= 0) {
            feedTime = MIN_FEED_INTERVAL + rand.nextInt(FEED_VARIANCE);

            AxisAlignedBB box = AxisAlignedBB.getBoundingBox(xCoord, yCoord - 1, zCoord, xCoord + 1, yCoord + 3, zCoord + 1);
            box = box.expand(AREA, 0, AREA);
            List<EntityAnimal> animals = (List<EntityAnimal>) worldObj.getEntitiesWithinAABB(EntityAnimal.class, box);

            for (EntityAnimal target : animals) {
                if (target.isBreedingItem(getStackInSlot(0)) && feedAnimal(target)) {
                    if (feedCounter <= 0) {
View Full Code Here

    @Override
    @SideOnly(Side.CLIENT)
    public AxisAlignedBB getRenderBoundingBox ()
    {
        AxisAlignedBB cbb = AxisAlignedBB.getBoundingBox(xCoord, yCoord - 1, zCoord, xCoord + 1, yCoord + 1, zCoord + 1);
        return cbb;
    }
View Full Code Here

    }

    @Override
    public boolean onLeftClickEntity (ItemStack stack, EntityPlayer player, Entity entity)
    {
        AxisAlignedBB box = AxisAlignedBB.getBoundingBox(entity.posX, entity.posY, entity.posZ, entity.posX + 1.0D, entity.posY + 1.0D, entity.posZ + 1.0D).expand(1.0D, 1.0D, 1.0D);
        List list = player.worldObj.getEntitiesWithinAABBExcludingEntity(player, box);
        for (Object o : list)
        {
            AbilityHelper.onLeftClickEntity(stack, player, (Entity) o, this);
        }
View Full Code Here

  @Override
  public AxisAlignedBB getSelectedBoundingBoxFromPool(World world, int x, int y, int z) {
    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.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.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.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

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.