コード例 #1
0
  public static StructureBoundingBox func_35027_a(
      List list, Random random, int i, int j, int k, int l) {
    StructureBoundingBox structureboundingbox = new StructureBoundingBox(i, j - 5, k, i, j + 2, k);
    switch (l) {
      case 2: // '\002'
        structureboundingbox.maxX = i + 2;
        structureboundingbox.minZ = k - 8;
        break;

      case 0: // '\0'
        structureboundingbox.maxX = i + 2;
        structureboundingbox.maxZ = k + 8;
        break;

      case 1: // '\001'
        structureboundingbox.minX = i - 8;
        structureboundingbox.maxZ = k + 2;
        break;

      case 3: // '\003'
        structureboundingbox.maxX = i + 8;
        structureboundingbox.maxZ = k + 2;
        break;
    }
    if (StructureComponent.getIntersectingStructureComponent(list, structureboundingbox) != null) {
      return null;
    } else {
      return structureboundingbox;
    }
  }
コード例 #2
0
  public static StructureBoundingBox findValidPlacement(
      List par0List, Random par1Random, int par2, int par3, int par4, int par5) {
    StructureBoundingBox structureboundingbox =
        new StructureBoundingBox(par2, par3, par4, par2, par3 + 2, par4);
    int i = par1Random.nextInt(3) + 2;

    do {
      if (i <= 0) {
        break;
      }

      int j = i * 5;

      switch (par5) {
        case 2:
          structureboundingbox.maxX = par2 + 2;
          structureboundingbox.minZ = par4 - (j - 1);
          break;

        case 0:
          structureboundingbox.maxX = par2 + 2;
          structureboundingbox.maxZ = par4 + (j - 1);
          break;

        case 1:
          structureboundingbox.minX = par2 - (j - 1);
          structureboundingbox.maxZ = par4 + 2;
          break;

        case 3:
          structureboundingbox.maxX = par2 + (j - 1);
          structureboundingbox.maxZ = par4 + 2;
          break;
      }

      if (StructureComponent.findIntersecting(par0List, structureboundingbox) == null) {
        break;
      }

      i--;
    } while (true);

    if (i > 0) {
      return structureboundingbox;
    } else {
      return null;
    }
  }