Examples of AxisAlignedBB


Examples of net.minecraft.util.AxisAlignedBB

      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

Examples of net.minecraft.util.AxisAlignedBB

  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

Examples of net.minecraft.util.AxisAlignedBB

    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

Examples of net.minecraft.util.AxisAlignedBB

    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

Examples of net.minecraft.util.AxisAlignedBB

  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

Examples of net.minecraft.util.AxisAlignedBB

  }

  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

Examples of net.minecraft.util.AxisAlignedBB

  {
    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

Examples of net.minecraft.util.AxisAlignedBB

  }

  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

Examples of net.minecraft.util.AxisAlignedBB

 

  private void doHoover() {

    BoundingBox bb = new BoundingBox(getLocation());
    AxisAlignedBB aabb = AxisAlignedBB.getBoundingBox(bb.minX, bb.minY, bb.minZ, bb.maxX, bb.maxY, bb.maxZ);
    aabb = aabb.expand(RANGE, RANGE, RANGE);
    List<EntityItem> interestingItems = worldObj.selectEntitiesWithinAABB(EntityItem.class, aabb, this);

    for (EntityItem entity : interestingItems) {
      double x = (xCoord + 0.5D - entity.posX);
      double y = (yCoord + 0.5D - entity.posY);
View Full Code Here

Examples of net.minecraft.util.AxisAlignedBB

    Vector3d pos;
    float volume;
    boolean isEntity;

    public SoundSource(Entity ent, float volume) {
      AxisAlignedBB bb = ent.boundingBox;
      if(bb != null) {
        pos = new Vector3d(bb.minX + (bb.maxX - bb.minX) / 2, bb.minY + (bb.maxY - bb.minY) / 2, bb.minZ + (bb.maxZ - bb.minZ) / 2);
      } else {
        pos = new Vector3d(ent.posX, ent.posY, ent.posZ);
      }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.