Beispiel #1
0
  public int c(IBlockState iblockstate) {
    byte b0 = 0;
    int i0 = b0 | ((BlockPlanks.EnumType) iblockstate.b(a)).a();

    i0 |= ((Integer) iblockstate.b(b)).intValue() << 3;
    return i0;
  }
Beispiel #2
0
 public void d(World world, BlockPos blockpos, IBlockState iblockstate, Random random) {
   if (((Integer) iblockstate.b(b)).intValue() == 0) {
     // CanaryMod: BlockGrowHook
     if (!new BlockGrowHook(
             CanaryBlock.getPooledBlock(iblockstate, blockpos, world),
             CanaryBlock.getPooledBlock(iblockstate.a(b), blockpos, world))
         .isCanceled()) {
       world.a(blockpos, iblockstate.a(b), 4);
     }
     //
   } else {
     // CanaryMod: TreeGrow; If someone figures out how to get more information into this, let me
     // know - darkdiplomat;
     if (!new TreeGrowHook(CanaryBlock.getPooledBlock(iblockstate, blockpos, world))
         .call()
         .isCanceled()) {
       this.e(world, blockpos, iblockstate, random);
     }
     //
   }
 }
Beispiel #3
0
  public void e(World world, BlockPos blockpos, IBlockState iblockstate, Random random) {
    Object object = random.nextInt(10) == 0 ? new WorldGenBigTree(true) : new WorldGenTrees(true);
    int i0 = 0;
    int i1 = 0;
    boolean flag0 = false;

    switch (BlockSapling.SwitchEnumType.a[((BlockPlanks.EnumType) iblockstate.b(a)).ordinal()]) {
      case 1:
        label78:
        for (i0 = 0; i0 >= -1; --i0) {
          for (i1 = 0; i1 >= -1; --i1) {
            if (this.a(world, blockpos.a(i0, 0, i1), BlockPlanks.EnumType.SPRUCE)
                && this.a(world, blockpos.a(i0 + 1, 0, i1), BlockPlanks.EnumType.SPRUCE)
                && this.a(world, blockpos.a(i0, 0, i1 + 1), BlockPlanks.EnumType.SPRUCE)
                && this.a(world, blockpos.a(i0 + 1, 0, i1 + 1), BlockPlanks.EnumType.SPRUCE)) {
              object = new WorldGenMegaPineTree(false, random.nextBoolean());
              flag0 = true;
              break label78;
            }
          }
        }

        if (!flag0) {
          i1 = 0;
          i0 = 0;
          object = new WorldGenTaiga2(true);
        }
        break;

      case 2:
        object = new WorldGenForest(true, false);
        break;

      case 3:
        label93:
        for (i0 = 0; i0 >= -1; --i0) {
          for (i1 = 0; i1 >= -1; --i1) {
            if (this.a(world, blockpos.a(i0, 0, i1), BlockPlanks.EnumType.JUNGLE)
                && this.a(world, blockpos.a(i0 + 1, 0, i1), BlockPlanks.EnumType.JUNGLE)
                && this.a(world, blockpos.a(i0, 0, i1 + 1), BlockPlanks.EnumType.JUNGLE)
                && this.a(world, blockpos.a(i0 + 1, 0, i1 + 1), BlockPlanks.EnumType.JUNGLE)) {
              object =
                  new WorldGenMegaJungle(
                      true,
                      10,
                      20,
                      BlockPlanks.EnumType.JUNGLE.a(),
                      BlockPlanks.EnumType.JUNGLE.a());
              flag0 = true;
              break label93;
            }
          }
        }

        if (!flag0) {
          i1 = 0;
          i0 = 0;
          object =
              new WorldGenTrees(
                  true,
                  4 + random.nextInt(7),
                  BlockPlanks.EnumType.JUNGLE.a(),
                  BlockPlanks.EnumType.JUNGLE.a(),
                  false);
        }
        break;

      case 4:
        object = new WorldGenSavannaTree(true);
        break;

      case 5:
        label108:
        for (i0 = 0; i0 >= -1; --i0) {
          for (i1 = 0; i1 >= -1; --i1) {
            if (this.a(world, blockpos.a(i0, 0, i1), BlockPlanks.EnumType.DARK_OAK)
                && this.a(world, blockpos.a(i0 + 1, 0, i1), BlockPlanks.EnumType.DARK_OAK)
                && this.a(world, blockpos.a(i0, 0, i1 + 1), BlockPlanks.EnumType.DARK_OAK)
                && this.a(world, blockpos.a(i0 + 1, 0, i1 + 1), BlockPlanks.EnumType.DARK_OAK)) {
              object = new WorldGenCanopyTree(true);
              flag0 = true;
              break label108;
            }
          }
        }

        if (!flag0) {
          return;
        }

      case 6:
    }

    IBlockState iblockstate1 = Blocks.a.P();

    if (flag0) {
      world.a(blockpos.a(i0, 0, i1), iblockstate1, 4);
      world.a(blockpos.a(i0 + 1, 0, i1), iblockstate1, 4);
      world.a(blockpos.a(i0, 0, i1 + 1), iblockstate1, 4);
      world.a(blockpos.a(i0 + 1, 0, i1 + 1), iblockstate1, 4);
    } else {
      world.a(blockpos, iblockstate1, 4);
    }

    if (!((WorldGenerator) object).b(world, random, blockpos.a(i0, 0, i1))) {
      if (flag0) {
        world.a(blockpos.a(i0, 0, i1), iblockstate, 4);
        world.a(blockpos.a(i0 + 1, 0, i1), iblockstate, 4);
        world.a(blockpos.a(i0, 0, i1 + 1), iblockstate, 4);
        world.a(blockpos.a(i0 + 1, 0, i1 + 1), iblockstate, 4);
      } else {
        world.a(blockpos, iblockstate, 4);
      }
    }
  }
Beispiel #4
0
 public int a(IBlockState iblockstate) {
   return ((BlockPlanks.EnumType) iblockstate.b(a)).a();
 }
Beispiel #5
0
  public boolean a(World world, BlockPos blockpos, BlockPlanks.EnumType blockplanks_enumtype) {
    IBlockState iblockstate = world.p(blockpos);

    return iblockstate.c() == this && iblockstate.b(a) == blockplanks_enumtype;
  }