コード例 #1
0
ファイル: SaveHandler.java プロジェクト: ppypp/CanaryMod
  @Override
  public WorldInfo d() {
    File file1 = new File(this.worldDir, "level.dat");
    NBTTagCompound nbttagcompound;
    NBTTagCompound nbttagcompound1;

    if (file1.exists()) {
      try {
        nbttagcompound = CompressedStreamTools.a((InputStream) (new FileInputStream(file1)));
        nbttagcompound1 = nbttagcompound.m("Data");
        return new WorldInfo(nbttagcompound1);
      } catch (Exception exception) {
        exception.printStackTrace();
      }
    }

    file1 = new File(this.worldDir, "level.dat_old");
    if (file1.exists()) {
      try {
        nbttagcompound = CompressedStreamTools.a((InputStream) (new FileInputStream(file1)));
        nbttagcompound1 = nbttagcompound.m("Data");
        return new WorldInfo(nbttagcompound1);
      } catch (Exception exception1) {
        exception1.printStackTrace();
      }
    }

    return null;
  }
コード例 #2
0
ファイル: ItemStack.java プロジェクト: ppypp/CanaryMod
  public void c(NBTTagCompound nbttagcompound) {
    if (nbttagcompound.b("id", 8)) {
      this.d = Item.d(nbttagcompound.j("id"));
    } else {
      this.d = Item.b(nbttagcompound.e("id"));
    }

    this.b = nbttagcompound.d("Count");
    this.f = nbttagcompound.e("Damage");
    if (this.f < 0) {
      this.f = 0;
    }

    if (nbttagcompound.b("tag", 10)) {
      this.e = nbttagcompound.m("tag");
      if (this.d != null) {
        this.d.a(this.e);
      }
    }
  }