Ejemplo n.º 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");
   }
 }
  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]);
    }
  }
Ejemplo n.º 3
0
 public static IPosition func_82525_a(IBlockSource p_82525_0_) {
   EnumFacing var1 = func_100009_j_(p_82525_0_.func_82620_h());
   double var2 = p_82525_0_.func_82615_a() + 0.7D * (double) var1.func_82601_c();
   double var4 = p_82525_0_.func_82617_b() + 0.7D * (double) var1.func_96559_d();
   double var6 = p_82525_0_.func_82616_c() + 0.7D * (double) var1.func_82599_e();
   return new PositionImpl(var2, var4, var6);
 }
  public ItemStack dispenseStack(IBlockSource blockSource, ItemStack itemstack) {
    EnumFacing facing = EnumFacing.func_82600_a(blockSource.func_82620_h());
    World world = blockSource.getWorld();
    int targetX = blockSource.getXInt() + facing.func_82601_c();
    int targetY = blockSource.getYInt();
    int targetZ = blockSource.getZInt() + facing.func_82599_e();

    TileEntity te = world.getBlockTileEntity(targetX, targetY, targetZ);
    if (te != null && te instanceof ITankContainer) {
      return fillOrEmptyContainer((ITankContainer) te, itemstack, facing);
    }
    if (world.isAirBlock(targetX, targetY, targetZ)) {
      TileEntity tileabove = world.getBlockTileEntity(targetX, targetY + 1, targetZ);
      TileEntity tilebelow = world.getBlockTileEntity(targetX, targetY - 1, targetZ);
      if (tileabove != null && LiquidContainerRegistry.isEmptyContainer(itemstack)) {
        return fillContainer((ITankContainer) tileabove, itemstack, EnumFacing.UP);
      }
      if (tilebelow != null && LiquidContainerRegistry.isFilledContainer(itemstack)) {
        return emptyContainer((ITankContainer) tilebelow, itemstack, EnumFacing.DOWN);
      }
    }
    System.out.println("Not matched");

    return null;
  }
 protected void spawnDispenseParticles(IBlockSource blockSource) {
   EnumFacing facing = EnumFacing.func_82600_a(blockSource.func_82620_h());
   blockSource
       .getWorld()
       .playAuxSFX(
           2000,
           blockSource.getXInt(),
           blockSource.getYInt(),
           blockSource.getZInt(),
           facing.func_82601_c() + 1 + (facing.func_82599_e() + 1) * 3);
 }
 public ItemStack func_82487_b(IBlockSource p_82487_1_, ItemStack p_82487_2_) {
   ItemBucket var3 = (ItemBucket) p_82487_2_.func_77973_b();
   int var4 = p_82487_1_.func_82623_d();
   int var5 = p_82487_1_.func_82622_e();
   int var6 = p_82487_1_.func_82621_f();
   EnumFacing var7 = BlockDispenser.func_100009_j_(p_82487_1_.func_82620_h());
   if (var3.func_77875_a(
       p_82487_1_.func_82618_k(),
       (double) var4,
       (double) var5,
       (double) var6,
       var4 + var7.func_82601_c(),
       var5 + var7.func_96559_d(),
       var6 + var7.func_82599_e())) {
     p_82487_2_.field_77993_c = Item.field_77788_aw.field_77779_bT;
     p_82487_2_.field_77994_a = 1;
     return p_82487_2_;
   } else {
     return this.field_96459_b.func_82482_a(p_82487_1_, p_82487_2_);
   }
 }