コード例 #1
0
  protected void a(NBTTagCompound var1) {
    if (var1.getBoolean("CustomDisplayTile")) {
      int var2 = var1.getInt("DisplayData");
      Block var3;
      if (var1.hasKeyOfType("DisplayTile", 8)) {
        var3 = Block.getByName(var1.getString("DisplayTile"));
        if (var3 == null) {
          this.setDisplayBlock(Blocks.AIR.getBlockData());
        } else {
          this.setDisplayBlock(var3.fromLegacyData(var2));
        }
      } else {
        var3 = Block.getById(var1.getInt("DisplayTile"));
        if (var3 == null) {
          this.setDisplayBlock(Blocks.AIR.getBlockData());
        } else {
          this.setDisplayBlock(var3.fromLegacyData(var2));
        }
      }

      this.SetDisplayBlockOffset(var1.getInt("DisplayOffset"));
    }

    if (var1.hasKeyOfType("CustomName", 8) && var1.getString("CustomName").length() > 0) {
      this.b = var1.getString("CustomName");
    }
  }
コード例 #2
0
ファイル: BlockPortal.java プロジェクト: MineHQ/mc-dev-1.8.7
 public void doPhysics(World var1, BlockPosition var2, IBlockData var3, Block var4) {
   EnumDirection.EnumAxis var5 = (EnumDirection.EnumAxis) var3.get(AXIS);
   BlockPortal.Shape var6;
   if (var5 == EnumDirection.EnumAxis.X) {
     var6 = new BlockPortal.Shape(var1, var2, EnumDirection.EnumAxis.X);
     if (!var6.d() || var6.e < var6.h * var6.g) {
       var1.setTypeUpdate(var2, Blocks.AIR.getBlockData());
     }
   } else if (var5 == EnumDirection.EnumAxis.Z) {
     var6 = new BlockPortal.Shape(var1, var2, EnumDirection.EnumAxis.Z);
     if (!var6.d() || var6.e < var6.h * var6.g) {
       var1.setTypeUpdate(var2, Blocks.AIR.getBlockData());
     }
   }
 }
コード例 #3
0
 public IBlockData u() {
   return Blocks.AIR.getBlockData();
 }
コード例 #4
0
ファイル: BlockPumpkin.java プロジェクト: MineHQ/mc-dev-1.8.7
  private void f(World var1, BlockPosition var2) {
    ShapeDetector.ShapeDetectorCollection var3;
    int var4;
    int var6;
    if ((var3 = this.getDetectorSnowGolem().a(var1, var2)) != null) {
      for (var4 = 0; var4 < this.getDetectorSnowGolem().b(); ++var4) {
        ShapeDetectorBlock var5 = var3.a(0, var4, 0);
        var1.setTypeAndData(var5.d(), Blocks.AIR.getBlockData(), 2);
      }

      EntitySnowman var9 = new EntitySnowman(var1);
      BlockPosition var10 = var3.a(0, 2, 0).d();
      var9.setPositionRotation(
          (double) var10.getX() + 0.5D,
          (double) var10.getY() + 0.05D,
          (double) var10.getZ() + 0.5D,
          0.0F,
          0.0F);
      var1.addEntity(var9);

      for (var6 = 0; var6 < 120; ++var6) {
        var1.addParticle(
            EnumParticle.SNOW_SHOVEL,
            (double) var10.getX() + var1.random.nextDouble(),
            (double) var10.getY() + var1.random.nextDouble() * 2.5D,
            (double) var10.getZ() + var1.random.nextDouble(),
            0.0D,
            0.0D,
            0.0D,
            new int[0]);
      }

      for (var6 = 0; var6 < this.getDetectorSnowGolem().b(); ++var6) {
        ShapeDetectorBlock var7 = var3.a(0, var6, 0);
        var1.update(var7.d(), Blocks.AIR);
      }
    } else if ((var3 = this.getDetectorIronGolem().a(var1, var2)) != null) {
      for (var4 = 0; var4 < this.getDetectorIronGolem().c(); ++var4) {
        for (int var12 = 0; var12 < this.getDetectorIronGolem().b(); ++var12) {
          var1.setTypeAndData(var3.a(var4, var12, 0).d(), Blocks.AIR.getBlockData(), 2);
        }
      }

      BlockPosition var11 = var3.a(1, 2, 0).d();
      EntityIronGolem var13 = new EntityIronGolem(var1);
      var13.setPlayerCreated(true);
      var13.setPositionRotation(
          (double) var11.getX() + 0.5D,
          (double) var11.getY() + 0.05D,
          (double) var11.getZ() + 0.5D,
          0.0F,
          0.0F);
      var1.addEntity(var13);

      for (var6 = 0; var6 < 120; ++var6) {
        var1.addParticle(
            EnumParticle.SNOWBALL,
            (double) var11.getX() + var1.random.nextDouble(),
            (double) var11.getY() + var1.random.nextDouble() * 3.9D,
            (double) var11.getZ() + var1.random.nextDouble(),
            0.0D,
            0.0D,
            0.0D,
            new int[0]);
      }

      for (var6 = 0; var6 < this.getDetectorIronGolem().c(); ++var6) {
        for (int var14 = 0; var14 < this.getDetectorIronGolem().b(); ++var14) {
          ShapeDetectorBlock var8 = var3.a(var6, var14, 0);
          var1.update(var8.d(), Blocks.AIR);
        }
      }
    }
  }