Examples of AxisAlignedBB


Examples of net.minecraft.util.AxisAlignedBB

  @Override
  public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ)
  {
    if(player.isSneaking())
    {
      AxisAlignedBB bound = AxisAlignedBB.getBoundingBox(x, y, z, x+1, y+3, z+1);

      List<EntityBalloon> balloonsNear = player.worldObj.getEntitiesWithinAABB(EntityBalloon.class, bound);

      if(balloonsNear.size() > 0)
      {
View Full Code Here

Examples of net.minecraft.util.AxisAlignedBB

  {
    if(player.isSneaking())
    {
      if(!player.worldObj.isRemote)
      {
        AxisAlignedBB bound = AxisAlignedBB.getBoundingBox(entity.posX - 0.2, entity.posY - 0.5, entity.posZ - 0.2, entity.posX + 0.2, entity.posY + entity.ySize + 4, entity.posZ + 0.2);

        List<EntityBalloon> balloonsNear = player.worldObj.getEntitiesWithinAABB(EntityBalloon.class, bound);

        for(EntityBalloon balloon : balloonsNear)
        {
View Full Code Here

Examples of net.minecraft.util.AxisAlignedBB

      List<EntityLivingBase> entities = source.getWorld().getEntitiesWithinAABB(EntityLivingBase.class, coord.getFromSide(side).getBoundingBox());
      boolean latched = false;
     
      for(EntityLivingBase entity : entities)
      {
        AxisAlignedBB bound = AxisAlignedBB.getBoundingBox(entity.posX - 0.2, entity.posY - 0.5, entity.posZ - 0.2, entity.posX + 0.2, entity.posY + entity.ySize + 4, entity.posZ + 0.2);

        List<EntityBalloon> balloonsNear = source.getWorld().getEntitiesWithinAABB(EntityBalloon.class, bound);
        boolean hasBalloon = false;
       
        for(EntityBalloon balloon : balloonsNear)
View Full Code Here

Examples of net.minecraft.util.AxisAlignedBB

        Block i = this.worldObj.getBlock(this.xTile, this.yTile, this.zTile);

        if (i != null)
        {
            i.setBlockBoundsBasedOnState(this.worldObj, this.xTile, this.yTile, this.zTile);
            AxisAlignedBB axisalignedbb = i.getCollisionBoundingBoxFromPool(this.worldObj, this.xTile, this.yTile, this.zTile);

            if (axisalignedbb != null && axisalignedbb.isVecInside(Vec3.createVectorHelper(this.posX, this.posY, this.posZ)))
            {
                this.inGround = true;
            }
        }

        if (this.arrowShake > 0)
        {
            --this.arrowShake;
        }

        if (this.inGround)
        {
            Block j = this.worldObj.getBlock(this.xTile, this.yTile, this.zTile);
            int k = this.worldObj.getBlockMetadata(this.xTile, this.yTile, this.zTile);

            if (j == this.inTile && k == this.inData)
            {
                ++this.ticksInGround;

                if (this.ticksInGround == 1200)
                {
                    this.setDead();
                }
            }
            else
            {
                this.inGround = false;
                this.motionX *= this.rand.nextFloat() * 0.2F;
                this.motionY *= this.rand.nextFloat() * 0.2F;
                this.motionZ *= this.rand.nextFloat() * 0.2F;
                this.ticksInGround = 0;
                this.ticksInAir = 0;
            }
        }
        else
        {
            ++this.ticksInAir;
            Vec3 vec3 = Vec3.createVectorHelper(this.posX, this.posY, this.posZ);
            Vec3 vec31 = Vec3.createVectorHelper(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ);
            // TODO 1.7 May need to call overload with extra params
            MovingObjectPosition movingobjectposition = this.worldObj.rayTraceBlocks(vec3, vec31, false);
            vec3 = Vec3.createVectorHelper(this.posX, this.posY, this.posZ);
            vec31 = Vec3.createVectorHelper(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ);

            if (movingobjectposition != null)
            {
                vec31 = Vec3.createVectorHelper(movingobjectposition.hitVec.xCoord, movingobjectposition.hitVec.yCoord, movingobjectposition.hitVec.zCoord);
            }

            Entity entity = null;
            List list = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.boundingBox.addCoord(this.motionX, this.motionY, this.motionZ).expand(1.0D, 1.0D, 1.0D));
            double d0 = 0.0D;
            int l;
            float f1;

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

                if (entity1.canBeCollidedWith() && (entity1 != this.shootingEntity || this.ticksInAir >= 5))
                {
                    f1 = 0.3F;
                    AxisAlignedBB axisalignedbb1 = entity1.boundingBox.expand(f1, f1, f1);
                    MovingObjectPosition movingobjectposition1 = axisalignedbb1.calculateIntercept(vec3, vec31);

                    if (movingobjectposition1 != null)
                    {
                        double d1 = vec3.distanceTo(movingobjectposition1.hitVec);

View Full Code Here

Examples of net.minecraft.util.AxisAlignedBB

    {
      Entity e = (Entity)list.get(l);
     
      if(e.canBeCollidedWith() && (e != _owner || this.ticksInAir >= 5))
      {
        AxisAlignedBB entitybb = e.boundingBox.expand(collisionRange, collisionRange, collisionRange);
        MovingObjectPosition entityHitPos = entitybb.calculateIntercept(pos, nextPos);
       
        if(entityHitPos != null)
        {
          double range = pos.distanceTo(entityHitPos.hitVec);
         
View Full Code Here

Examples of net.minecraft.util.AxisAlignedBB

      {
        Entity e = (Entity)list.get(i);
       
        if(e.canBeCollidedWith() && (e != _owner))
        {
          AxisAlignedBB entitybb = e.boundingBox.expand(collisionRange, collisionRange, collisionRange);
          MovingObjectPosition entityHitPos = entitybb.calculateIntercept(pos, nextPos);
         
          if(entityHitPos != null)
          {
            double range = pos.distanceTo(entityHitPos.hitVec);
           
View Full Code Here

Examples of net.minecraft.util.AxisAlignedBB

    {

      int offsetX = Facing.offsetsXForSide[side];
      int offsetY = side == 0 ? -1 : 0;
      int offsetZ = Facing.offsetsZForSide[side];
      AxisAlignedBB bb =  e.boundingBox;
     
      e.setLocationAndAngles(x + (bb.maxX - bb.minX) * 0.5 * offsetX,
          y + (bb.maxY - bb.minY) * 0.5 * offsetY,
          z + (bb.maxZ - bb.minZ) * 0.5 * offsetZ,
          world.rand.nextFloat() * 360.0F, 0.0F);
View Full Code Here

Examples of net.minecraft.util.AxisAlignedBB

    int closest = -1;
    double closestdistance = Double.MAX_VALUE;
   
    for(int i = 0; i < wireparts.length; i++)
    {
      AxisAlignedBB part = wireparts[i];
      if(part == null)
      {
        continue;
      }
      MovingObjectPosition hit = part.calculateIntercept(playerPosition, playerViewOffset);
      if(hit != null)
      {
        double distance = playerPosition.distanceTo(hit.hitVec);
        if(distance < closestdistance)
        {
View Full Code Here

Examples of net.minecraft.util.AxisAlignedBB

    if(minecart.riddenByEntity != null)
    {
      return;
    }
   
    AxisAlignedBB bb = AxisAlignedBB.getBoundingBox(
        x - MFRConfig.passengerRailSearchMaxHorizontal.getInt(),
        y - MFRConfig.passengerRailSearchMaxVertical.getInt(),
        z - MFRConfig.passengerRailSearchMaxHorizontal.getInt(),
        x + MFRConfig.passengerRailSearchMaxHorizontal.getInt() + 1,
        y + MFRConfig.passengerRailSearchMaxVertical.getInt() + 1,
View Full Code Here

Examples of net.minecraft.util.AxisAlignedBB

  }

  @SuppressWarnings({ "unchecked", "rawtypes" })
  protected void addCollidingBlockToList_do(World world, int x, int y, int z, AxisAlignedBB aabb, List blockList, Entity e)
  {
    AxisAlignedBB newAABB = this.getCollisionBoundingBoxFromPool(world, x, y, z);

    if (newAABB != null && aabb.intersectsWith(newAABB))
    {
      blockList.add(newAABB);
    }
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.