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");
    }
  }
Ejemplo n.º 2
0
 public void a(NBTTagCompound nbttagcompound) {
   super.a(nbttagcompound);
   this.a = Block.getById(nbttagcompound.getInt("blockId"));
   this.i = nbttagcompound.getInt("blockData");
   this.j = nbttagcompound.getInt("facing");
   this.n = this.m = nbttagcompound.getFloat("progress");
   this.k = nbttagcompound.getBoolean("extending");
 }
Ejemplo n.º 3
0
 public void a(NBTTagCompound nbttagcompound) {
   super.a(nbttagcompound);
   this.setCarried(Block.getById(nbttagcompound.getShort("carried")));
   this.setCarriedData(nbttagcompound.getShort("carriedData"));
 }
Ejemplo n.º 4
0
 public Block getCarried() {
   return Block.getById(this.datawatcher.getByte(16));
 }
Ejemplo n.º 5
0
  private static WorldGenFlatLayerInfo a(int i, String s, int j) {
    String[] astring = i >= 3 ? s.split("\\*", 2) : s.split("x", 2);
    int k = 1;
    int l = 0;

    if (astring.length == 2) {
      try {
        k = Integer.parseInt(astring[0]);
        if (j + k >= 256) {
          k = 256 - j;
        }

        if (k < 0) {
          k = 0;
        }
      } catch (Throwable throwable) {
        return null;
      }
    }

    Block block = null;

    try {
      String s1 = astring[astring.length - 1];

      if (i < 3) {
        astring = s1.split(":", 2);
        if (astring.length > 1) {
          l = Integer.parseInt(astring[1]);
        }

        block = Block.getById(Integer.parseInt(astring[0]));
      } else {
        astring = s1.split(":", 3);
        block = astring.length > 1 ? Block.getByName(astring[0] + ":" + astring[1]) : null;
        if (block != null) {
          l = astring.length > 2 ? Integer.parseInt(astring[2]) : 0;
        } else {
          block = Block.getByName(astring[0]);
          if (block != null) {
            l = astring.length > 1 ? Integer.parseInt(astring[1]) : 0;
          }
        }

        if (block == null) {
          return null;
        }
      }

      if (block == Blocks.AIR) {
        l = 0;
      }

      if (l < 0 || l > 15) {
        l = 0;
      }
    } catch (Throwable throwable1) {
      return null;
    }

    WorldGenFlatLayerInfo worldgenflatlayerinfo = new WorldGenFlatLayerInfo(i, k, block, l);

    worldgenflatlayerinfo.b(j);
    return worldgenflatlayerinfo;
  }