protected NBTTagList a() {
    NBTTagList var1 = new NBTTagList();
    Collection var2 = this.c.g();
    Iterator var3 = var2.iterator();

    while (var3.hasNext()) {
      class_awk var4 = (class_awk) var3.next();
      NBTTagCompound var5 = new NBTTagCompound();
      var5.put("Name", var4.b());
      var5.put("DisplayName", var4.c());
      if (var4.l().getId() >= 0) {
        var5.put("TeamColor", var4.l().getName());
      }

      var5.put("Prefix", var4.e());
      var5.put("Suffix", var4.f());
      var5.put("AllowFriendlyFire", var4.g());
      var5.put("SeeFriendlyInvisibles", var4.h());
      var5.put("NameTagVisibility", var4.i().e);
      var5.put("DeathMessageVisibility", var4.j().e);
      NBTTagList var6 = new NBTTagList();
      Iterator var7 = var4.d().iterator();

      while (var7.hasNext()) {
        String var8 = (String) var7.next();
        var6.add((NBTTag) (new NBTTagString(var8)));
      }

      var5.put((String) "Players", (NBTTag) var6);
      var1.add((NBTTag) var5);
    }

    return var1;
  }
Ejemplo n.º 2
0
 public void readFromNBT(NBTTagCompound nbttagcompound) {
   super.readFromNBT(nbttagcompound);
   woodType = nbttagcompound.getByte("woodType");
   NBTTagList nbttaglist = nbttagcompound.getTagList("Items");
   storage = new ItemStack[getSizeInventory()];
   for (int i = 0; i < nbttaglist.tagCount(); i++) {
     NBTTagCompound nbttagcompound1 = (NBTTagCompound) nbttaglist.tagAt(i);
     byte byte0 = nbttagcompound1.getByte("Slot");
     if (byte0 >= 0 && byte0 < storage.length) {
       storage[byte0] = ItemStack.loadItemStackFromNBT(nbttagcompound1);
     }
   }
 }
Ejemplo n.º 3
0
  public void readFromNBT(NBTTagCompound nbttagcompound) {
    super.readFromNBT(nbttagcompound);
    // timeleft = nbttagcompound.getInteger("timeleft");

    NBTTagList nbttaglist = nbttagcompound.getTagList("Items");
    metalItemStacks = new ItemStack[getSizeInventory()];
    for (int i = 0; i < nbttaglist.tagCount(); i++) {
      NBTTagCompound nbttagcompound1 = (NBTTagCompound) nbttaglist.tagAt(i);
      byte byte0 = nbttagcompound1.getByte("Slot");
      if (byte0 >= 0 && byte0 < metalItemStacks.length) {
        metalItemStacks[byte0] = ItemStack.loadItemStackFromNBT(nbttagcompound1);
      }
    }
  }
Ejemplo n.º 4
0
 public void writeToNBT(NBTTagCompound nbttagcompound) {
   super.writeToNBT(nbttagcompound);
   NBTTagList nbttaglist = new NBTTagList();
   for (int i = 0; i < storage.length; i++) {
     if (storage[i] != null) {
       NBTTagCompound nbttagcompound1 = new NBTTagCompound();
       nbttagcompound1.setByte("Slot", (byte) i);
       storage[i].writeToNBT(nbttagcompound1);
       nbttaglist.appendTag(nbttagcompound1);
     }
   }
   nbttagcompound.setTag("Items", nbttaglist);
   nbttagcompound.setByte("woodType", woodType);
 }
Ejemplo n.º 5
0
 public static void e(ItemStack var0) {
   NBTTagCompound var1 = var0.a("BlockEntityTag", false);
   if (var1 != null && var1.hasKeyOfType("Patterns", 9)) {
     NBTTagList var2 = var1.getList("Patterns", 10);
     if (var2.size() > 0) {
       var2.a(var2.size() - 1);
       if (var2.isEmpty()) {
         var0.getTag().remove("BlockEntityTag");
         if (var0.getTag().isEmpty()) {
           var0.setTag((NBTTagCompound) null);
         }
       }
     }
   }
 }
Ejemplo n.º 6
0
  public void writeToNBT(NBTTagCompound nbttagcompound) {
    super.writeToNBT(nbttagcompound);
    // nbttagcompound.setInteger("timeleft", timeleft);

    NBTTagList nbttaglist = new NBTTagList();
    for (int i = 0; i < metalItemStacks.length; i++) {
      if (metalItemStacks[i] != null) {
        NBTTagCompound nbttagcompound1 = new NBTTagCompound();
        nbttagcompound1.setByte("Slot", (byte) i);
        metalItemStacks[i].writeToNBT(nbttagcompound1);
        nbttaglist.appendTag(nbttagcompound1);
      }
    }

    nbttagcompound.setTag("Items", nbttaglist);
  }
  protected void c(NBTTagList var1) {
    for (int var2 = 0; var2 < var1.getSize(); ++var2) {
      NBTTagCompound var3 = var1.getCompound(var2);
      class_awj var4 = this.c.b(var3.getString("Objective"));
      String var5 = var3.getString("Name");
      if (var5.length() > 40) {
        var5 = var5.substring(0, 40);
      }

      class_awl var6 = this.c.c(var5, var4);
      var6.c(var3.getInt("Score"));
      if (var3.has("Locked")) {
        var6.a(var3.getBoolean("Locked"));
      }
    }
  }
  protected void b(NBTTagList var1) {
    for (int var2 = 0; var2 < var1.getSize(); ++var2) {
      NBTTagCompound var3 = var1.getCompound(var2);
      class_awt var4 = (class_awt) class_awt.a.get(var3.getString("CriteriaName"));
      if (var4 != null) {
        String var5 = var3.getString("Name");
        if (var5.length() > 16) {
          var5 = var5.substring(0, 16);
        }

        class_awj var6 = this.c.a(var5, var4);
        var6.a(var3.getString("DisplayName"));
        var6.a(class_awt.class_a_in_class_awt.a(var3.getString("RenderType")));
      }
    }
  }
  protected void a(NBTTagList var1) {
    for (int var2 = 0; var2 < var1.getSize(); ++var2) {
      NBTTagCompound var3 = var1.getCompound(var2);
      String var4 = var3.getString("Name");
      if (var4.length() > 16) {
        var4 = var4.substring(0, 16);
      }

      class_awk var5 = this.c.e(var4);
      String var6 = var3.getString("DisplayName");
      if (var6.length() > 32) {
        var6 = var6.substring(0, 32);
      }

      var5.a(var6);
      if (var3.hasOfType("TeamColor", 8)) {
        var5.a(EnumChatFormat.getByName(var3.getString("TeamColor")));
      }

      var5.b(var3.getString("Prefix"));
      var5.c(var3.getString("Suffix"));
      if (var3.hasOfType("AllowFriendlyFire", 99)) {
        var5.a(var3.getBoolean("AllowFriendlyFire"));
      }

      if (var3.hasOfType("SeeFriendlyInvisibles", 99)) {
        var5.b(var3.getBoolean("SeeFriendlyInvisibles"));
      }

      class_awp.class_a_in_class_awp var7;
      if (var3.hasOfType("NameTagVisibility", 8)) {
        var7 = class_awp.class_a_in_class_awp.a(var3.getString("NameTagVisibility"));
        if (var7 != null) {
          var5.a(var7);
        }
      }

      if (var3.hasOfType("DeathMessageVisibility", 8)) {
        var7 = class_awp.class_a_in_class_awp.a(var3.getString("DeathMessageVisibility"));
        if (var7 != null) {
          var5.b(var7);
        }
      }

      this.a(var5, var3.getList("Players", 8));
    }
  }
Ejemplo n.º 10
0
  @Override
  void applyToItem(NBTTagCompound tag) {
    super.applyToItem(tag);
    if (hasCustomEffects()) {
      NBTTagList effectList = new NBTTagList();
      tag.set(POTION_EFFECTS.NBT, effectList);

      for (PotionEffect effect : customEffects) {
        NBTTagCompound effectData = new NBTTagCompound();
        effectData.setByte(ID.NBT, (byte) effect.getType().getId());
        effectData.setByte(AMPLIFIER.NBT, (byte) effect.getAmplifier());
        effectData.setInt(DURATION.NBT, effect.getDuration());
        effectData.setBoolean(AMBIENT.NBT, effect.isAmbient());
        effectList.add(effectData);
      }
    }
  }
  protected NBTTagList e() {
    NBTTagList var1 = new NBTTagList();
    Collection var2 = this.c.e();
    Iterator var3 = var2.iterator();

    while (var3.hasNext()) {
      class_awl var4 = (class_awl) var3.next();
      if (var4.d() != null) {
        NBTTagCompound var5 = new NBTTagCompound();
        var5.put("Name", var4.e());
        var5.put("Objective", var4.d().b());
        var5.put("Score", var4.c());
        var5.put("Locked", var4.g());
        var1.add((NBTTag) var5);
      }
    }

    return var1;
  }
  protected NBTTagList b() {
    NBTTagList var1 = new NBTTagList();
    Collection var2 = this.c.c();
    Iterator var3 = var2.iterator();

    while (var3.hasNext()) {
      class_awj var4 = (class_awj) var3.next();
      if (var4.c() != null) {
        NBTTagCompound var5 = new NBTTagCompound();
        var5.put("Name", var4.b());
        var5.put("CriteriaName", var4.c().a());
        var5.put("DisplayName", var4.d());
        var5.put("RenderType", var4.e().a());
        var1.add((NBTTag) var5);
      }
    }

    return var1;
  }
Ejemplo n.º 13
0
  CraftMetaPotion(NBTTagCompound tag) {
    super(tag);

    if (tag.hasKey(POTION_EFFECTS.NBT)) {
      NBTTagList list = tag.getList(POTION_EFFECTS.NBT);
      int length = list.size();
      if (length > 0) {
        customEffects = new ArrayList<PotionEffect>(length);

        for (int i = 0; i < length; i++) {
          NBTTagCompound effect = (NBTTagCompound) list.get(i);
          PotionEffectType type = PotionEffectType.getById(effect.getByte(ID.NBT));
          int amp = effect.getByte(AMPLIFIER.NBT);
          int duration = effect.getInt(DURATION.NBT);
          boolean ambient = effect.getBoolean(AMBIENT.NBT);
          customEffects.add(new PotionEffect(type, duration, amp, ambient));
        }
      }
    }
  }
Ejemplo n.º 14
0
  CraftMetaBook(NBTTagCompound tag) {
    super(tag);

    if (tag.hasKey(BOOK_TITLE.NBT)) {
      this.title = tag.getString(BOOK_TITLE.NBT);
    }

    if (tag.hasKey(BOOK_AUTHOR.NBT)) {
      this.author = tag.getString(BOOK_AUTHOR.NBT);
    }

    if (tag.hasKey(BOOK_PAGES.NBT)) {
      NBTTagList pages = tag.getList(BOOK_PAGES.NBT);
      String[] pageArray = new String[pages.size()];

      for (int i = 0; i < pages.size(); i++) {
        String page = ((NBTTagString) pages.get(i)).data;
        pageArray[i] = page;
      }

      addPage(pageArray);
    }
  }
Ejemplo n.º 15
0
  @Override
  public boolean update(boolean force, boolean applyPhysics) {
    boolean result = (isPlaced()) ? super.update(force, applyPhysics) : true;

    if (result) {
      banner.color = base.getDyeData();

      NBTTagList newPatterns = new NBTTagList();

      for (Pattern p : patterns) {
        NBTTagCompound compound = new NBTTagCompound();
        compound.setInt("Color", p.getColor().getDyeData());
        compound.setString("Pattern", p.getPattern().getIdentifier());
        newPatterns.add(compound);
      }

      banner.patterns = newPatterns;

      banner.update();
    }

    return result;
  }
 protected void a(class_awk var1, NBTTagList var2) {
   for (int var3 = 0; var3 < var2.getSize(); ++var3) {
     this.c.a(var2.getString(var3), var1.b());
   }
 }