/** ********** BOXES ********** */
  @Override
  @SuppressWarnings({"rawtypes", "unchecked"})
  public void addCollisionBoxesToList(
      World world, int x, int y, int z, AxisAlignedBB aabb, List list, Entity entity) {
    final boolean flag = this.canConnectRopeTo(world, x, y, z - 1);
    final boolean flag1 = this.canConnectRopeTo(world, x, y, z + 1);
    final boolean flag2 = this.canConnectRopeTo(world, x - 1, y, z);
    final boolean flag3 = this.canConnectRopeTo(world, x + 1, y, z);
    float f = 0.375F;
    float f1 = 0.625F;
    float f2 = 0.375F;
    float f3 = 0.625F;

    if (flag) {
      f2 = 0.0F;
    }

    if (flag1) {
      f3 = 1.0F;
    }

    if (flag || flag1) {
      this.setBlockBounds(f, 0.4375F, f2, f1, 0.5625F, f3);
      super.addCollisionBoxesToList(world, x, y, z, aabb, list, entity);
    }

    f2 = 0.375F;
    f3 = 0.625F;

    if (flag2) {
      f = 0.0F;
    }

    if (flag3) {
      f1 = 1.0F;
    }

    if (flag2 || flag3 || !flag && !flag1) {
      this.setBlockBounds(f, 0.4375F, f2, f1, 0.5625F, f3);
      super.addCollisionBoxesToList(world, x, y, z, aabb, list, entity);
    }

    if (flag) {
      f2 = 0.0F;
    }

    if (flag1) {
      f3 = 1.0F;
    }

    this.setBlockBoundsBasedOnState(world, x, y, z);
  }
Ejemplo n.º 2
0
  public void addCollisionBoxesToList(
      World world, int x, int y, int z, AxisAlignedBB axisAlignedBB, List list, Entity entity) {
    if (world.getBlockMetadata(x, y, z) == 0) {
      this.setBlockBounds(0F, 0F, 0F, 1F, 0.5F, 1F);
      super.addCollisionBoxesToList(world, x, y, z, axisAlignedBB, list, entity);
      this.setBlockBounds(1F, 0F, 0F, 0.5F, 1F, 1F);
      super.addCollisionBoxesToList(world, x, y, z, axisAlignedBB, list, entity);
      this.setBlockBounds(0F, 0F, 0F, 1F, 1F, 1F);
    }

    if (world.getBlockMetadata(x, y, z) == 1) {
      this.setBlockBounds(0F, 0F, 0F, 1F, 0.5F, 1F);
      super.addCollisionBoxesToList(world, x, y, z, axisAlignedBB, list, entity);
      this.setBlockBounds(1F, 0F, 0F, 0.5F, 1F, 1F);
      super.addCollisionBoxesToList(world, x, y, z, axisAlignedBB, list, entity);
      this.setBlockBounds(0F, 0F, 0F, 1F, 1F, 1F);
    }

    if (world.getBlockMetadata(x, y, z) == 2) {
      this.setBlockBounds(0F, 0F, 0F, 1F, 0.5F, 1F);
      super.addCollisionBoxesToList(world, x, y, z, axisAlignedBB, list, entity);
      this.setBlockBounds(1F, 0F, 0F, 0.5F, 1F, 1F);
      super.addCollisionBoxesToList(world, x, y, z, axisAlignedBB, list, entity);
      this.setBlockBounds(0F, 0F, 0F, 1F, 1F, 1F);
    }

    if (world.getBlockMetadata(x, y, z) == 3) {
      this.setBlockBounds(0F, 0F, 0F, 1F, 0.5F, 1F);
      super.addCollisionBoxesToList(world, x, y, z, axisAlignedBB, list, entity);
      this.setBlockBounds(1F, 0F, 0F, 0.5F, 1F, 1F);
      super.addCollisionBoxesToList(world, x, y, z, axisAlignedBB, list, entity);
      this.setBlockBounds(0F, 0F, 0F, 1F, 1F, 1F);
    }
  }
 @Override
 public void addCollisionBoxesToList(
     World world,
     BlockPos pos,
     IBlockState state,
     AxisAlignedBB mask,
     List list,
     Entity collidingEntity) {
   setBlockBounds(0.25F, 0.0F, 0.25F, 0.75F, 0.35F, 0.75F);
   super.addCollisionBoxesToList(world, pos, state, mask, list, collidingEntity);
 }
Ejemplo n.º 4
0
 /**
  * Adds all intersecting collision boxes to a list. (Be sure to only add boxes to the list if they
  * intersect the mask.) Parameters: World, X, Y, Z, mask, list, colliding entity
  */
 public void addCollisionBoxesToList(
     World par1World,
     int par2,
     int par3,
     int par4,
     AxisAlignedBB par5AxisAlignedBB,
     List par6List,
     Entity par7Entity) {
   this.setBlockBoundsBasedOnState(par1World, par2, par3, par4);
   super.addCollisionBoxesToList(
       par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity);
 }
  @SuppressWarnings("rawtypes")
  @Override
  public void addCollisionBoxesToList(
      World world, int x, int y, int z, AxisAlignedBB axisalignedbb, List list, Entity entity) {
    TileEntity tileentity = world.getTileEntity(x, y, z);
    if (tileentity != null && tileentity instanceof TileEntityLittleChunk) {
      TileEntityLittleChunk tile = (TileEntityLittleChunk) tileentity;

      float m = ConfigurationLib.littleBlocksSize;

      AxisAlignedBB bb =
          AxisAlignedBB.getBoundingBox(
              axisalignedbb.minX * m,
              axisalignedbb.minY * m,
              axisalignedbb.minZ * m,
              axisalignedbb.maxX * m,
              axisalignedbb.maxY * m,
              axisalignedbb.maxZ * m);
      List<AxisAlignedBB> bbs = new ArrayList<AxisAlignedBB>();
      for (int xx = 0; xx < tile.size; xx++) {
        for (int yy = 0; yy < tile.size; yy++) {
          for (int zz = 0; zz < tile.size; zz++) {
            if (tile.getBlock(xx, yy, zz) != Blocks.air) {
              Block block = tile.getBlock(xx, yy, zz);
              if (block != null) {
                block.addCollisionBoxesToList(
                    (World) tile.getLittleWorld(),
                    (x << 3) + xx,
                    (y << 3) + yy,
                    (z << 3) + zz,
                    bb,
                    bbs,
                    entity);
              }
            }
          }
        }
      }
      for (AxisAlignedBB aabb : bbs) {
        aabb.setBounds(
            aabb.minX / m,
            aabb.minY / m,
            aabb.minZ / m,
            aabb.maxX / m,
            aabb.maxY / m,
            aabb.maxZ / m);
        list.add(aabb);
      }
    }
  }