コード例 #1
0
 protected static BlockPos func_177683_a(
     BlockPos p_177683_0_,
     EnumFacing p_177683_1_,
     EnumFacing p_177683_2_,
     int p_177683_3_,
     int p_177683_4_,
     int p_177683_5_) {
   if (p_177683_1_ != p_177683_2_ && p_177683_1_ != p_177683_2_.func_176734_d()) {
     Vec3i var6 =
         new Vec3i(
             p_177683_1_.func_82601_c(), p_177683_1_.func_96559_d(), p_177683_1_.func_82599_e());
     Vec3i var7 =
         new Vec3i(
             p_177683_2_.func_82601_c(), p_177683_2_.func_96559_d(), p_177683_2_.func_82599_e());
     Vec3i var8 = var6.func_177955_d(var7);
     return p_177683_0_.func_177982_a(
         var7.func_177958_n() * -p_177683_4_
             + var8.func_177958_n() * p_177683_3_
             + var6.func_177958_n() * p_177683_5_,
         var7.func_177956_o() * -p_177683_4_
             + var8.func_177956_o() * p_177683_3_
             + var6.func_177956_o() * p_177683_5_,
         var7.func_177952_p() * -p_177683_4_
             + var8.func_177952_p() * p_177683_3_
             + var6.func_177952_p() * p_177683_5_);
   } else {
     throw new IllegalArgumentException("Invalid forwards & up combination");
   }
 }
コード例 #2
0
  public BlockPattern.PatternHelper func_177681_a(World p_177681_1_, BlockPos p_177681_2_) {
    LoadingCache var3 = CacheBuilder.newBuilder().build(new BlockPattern.CacheLoader(p_177681_1_));
    int var4 = Math.max(Math.max(this.field_177686_d, this.field_177688_c), this.field_177687_b);
    Iterator var5 =
        BlockPos.func_177980_a(p_177681_2_, p_177681_2_.func_177982_a(var4 - 1, var4 - 1, var4 - 1))
            .iterator();

    while (var5.hasNext()) {
      BlockPos var6 = (BlockPos) var5.next();
      EnumFacing[] var7 = EnumFacing.values();
      int var8 = var7.length;

      for (int var9 = 0; var9 < var8; ++var9) {
        EnumFacing var10 = var7[var9];
        EnumFacing[] var11 = EnumFacing.values();
        int var12 = var11.length;

        for (int var13 = 0; var13 < var12; ++var13) {
          EnumFacing var14 = var11[var13];
          if (var14 != var10 && var14 != var10.func_176734_d()) {
            BlockPattern.PatternHelper var15 = this.func_177682_a(var6, var10, var14, var3);
            if (var15 != null) {
              return var15;
            }
          }
        }
      }
    }

    return null;
  }
コード例 #3
0
  public void func_180655_c(
      World p_180655_1_, BlockPos p_180655_2_, IBlockState p_180655_3_, Random p_180655_4_) {
    if (this.field_150113_a) {
      double var5 =
          (double) ((float) p_180655_2_.func_177958_n() + 0.5F)
              + (double) (p_180655_4_.nextFloat() - 0.5F) * 0.2D;
      double var7 =
          (double) ((float) p_180655_2_.func_177956_o() + 0.7F)
              + (double) (p_180655_4_.nextFloat() - 0.5F) * 0.2D;
      double var9 =
          (double) ((float) p_180655_2_.func_177952_p() + 0.5F)
              + (double) (p_180655_4_.nextFloat() - 0.5F) * 0.2D;
      EnumFacing var11 = (EnumFacing) p_180655_3_.func_177229_b(field_176596_a);
      if (var11.func_176740_k().func_176722_c()) {
        EnumFacing var12 = var11.func_176734_d();
        double var13 = 0.27000001072883606D;
        var5 += 0.27000001072883606D * (double) var12.func_82601_c();
        var7 += 0.2199999988079071D;
        var9 += 0.27000001072883606D * (double) var12.func_82599_e();
      }

      p_180655_1_.func_175688_a(
          EnumParticleTypes.REDSTONE, var5, var7, var9, 0.0D, 0.0D, 0.0D, new int[0]);
    }
  }
コード例 #4
0
 protected void func_176400_h(World p_176400_1_, BlockPos p_176400_2_, IBlockState p_176400_3_) {
   EnumFacing var4 = (EnumFacing) p_176400_3_.func_177229_b(field_176387_N);
   BlockPos var5 = p_176400_2_.func_177972_a(var4.func_176734_d());
   p_176400_1_.func_180496_d(var5, this);
   p_176400_1_.func_175695_a(var5, this, var4);
 }