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 d(NBTTagCompound nbttagcompound) {
    nbttagcompound.a(
        "Pos", (NBTBase) this.a(new double[] {this.locX, this.locY + (double) this.br, this.locZ}));
    nbttagcompound.a("Motion", (NBTBase) this.a(new double[] {this.motX, this.motY, this.motZ}));

    // CraftBukkit start - checking for NaN pitch/yaw and resetting to zero
    // TODO: make sure this is the best way to address this.
    if (Float.isNaN(this.yaw)) {
      this.yaw = 0;
    }

    if (Float.isNaN(this.pitch)) {
      this.pitch = 0;
    }
    // CraftBukkit end

    nbttagcompound.a("Rotation", (NBTBase) this.a(new float[] {this.yaw, this.pitch}));
    nbttagcompound.a("FallDistance", this.fallDistance);
    nbttagcompound.a("Fire", (short) this.fireTicks);
    nbttagcompound.a("Air", (short) this.airTicks);
    nbttagcompound.a("OnGround", this.onGround);
    // CraftBukkit start
    nbttagcompound.setString("World", world.worldData.name);
    nbttagcompound.a("UUIDLeast", this.uniqueId.getLeastSignificantBits());
    nbttagcompound.a("UUIDMost", this.uniqueId.getMostSignificantBits());
    // CraftBukkit end
    this.b(nbttagcompound);
  }
Ejemplo n.º 3
0
  public void a(NBTTagCompound nbttagcompound) {
    super.a(nbttagcompound);
    NBTTagList nbttaglist = nbttagcompound.getList("Inventory");

    this.inventory.b(nbttaglist);
    this.dimension = nbttagcompound.getInt("Dimension");
    this.sleeping = nbttagcompound.getBoolean("Sleeping");
    this.sleepTicks = nbttagcompound.getShort("SleepTimer");
    this.exp = nbttagcompound.getFloat("XpP");
    this.expLevel = nbttagcompound.getInt("XpLevel");
    this.expTotal = nbttagcompound.getInt("XpTotal");
    if (this.sleeping) {
      this.F =
          new ChunkCoordinates(
              MathHelper.floor(this.locX),
              MathHelper.floor(this.locY),
              MathHelper.floor(this.locZ));
      this.a(true, true, false);
    }

    if (nbttagcompound.hasKey("SpawnX")
        && nbttagcompound.hasKey("SpawnY")
        && nbttagcompound.hasKey("SpawnZ")) {
      this.b =
          new ChunkCoordinates(
              nbttagcompound.getInt("SpawnX"),
              nbttagcompound.getInt("SpawnY"),
              nbttagcompound.getInt("SpawnZ"));
    }

    this.foodData.a(nbttagcompound);
    this.abilities.b(nbttagcompound);
  }
Ejemplo n.º 4
0
  public static void a(Map map, ItemStack itemstack) {
    NBTTagList nbttaglist = new NBTTagList();
    Iterator iterator = map.keySet().iterator();

    while (iterator.hasNext()) {
      int i = ((Integer) iterator.next()).intValue();
      NBTTagCompound nbttagcompound = new NBTTagCompound();

      nbttagcompound.setShort("id", (short) i);
      nbttagcompound.setShort("lvl", (short) ((Integer) map.get(Integer.valueOf(i))).intValue());
      nbttaglist.add(nbttagcompound);
      if (itemstack.getItem() == Items.ENCHANTED_BOOK) {
        Items.ENCHANTED_BOOK.a(
            itemstack,
            new EnchantmentInstance(i, ((Integer) map.get(Integer.valueOf(i))).intValue()));
      }
    }

    if (nbttaglist.size() > 0) {
      if (itemstack.getItem() != Items.ENCHANTED_BOOK) {
        itemstack.a("ench", (NBTBase) nbttaglist);
      }
    } else if (itemstack.hasTag()) {
      itemstack.getTag().remove("ench");
    }
  }
Ejemplo n.º 5
0
 @Override
 public void a(NBTTagCompound nbttagcompound) {
   super.a(nbttagcompound);
   flow.readFromNBT(nbttagcompound);
   lastDir = nbttagcompound.getByte("lDir");
   paintColor = nbttagcompound.getByte("pCol");
 }
Ejemplo n.º 6
0
 @Override
 public void b(NBTTagCompound nbttagcompound) {
   super.b(nbttagcompound);
   flow.writeToNBT(nbttagcompound);
   nbttagcompound.setByte("lDir", lastDir);
   nbttagcompound.setByte("pCol", paintColor);
 }
Ejemplo n.º 7
0
 public void a(NBTTagCompound nbttagcompound) {
   nbttagcompound.a("xTile", (short) b);
   nbttagcompound.a("yTile", (short) c);
   nbttagcompound.a("zTile", (short) d);
   nbttagcompound.a("inTile", (byte) e);
   nbttagcompound.a("shake", (byte) a);
   nbttagcompound.a("inGround", (byte) (f ? 1 : 0));
 }
Ejemplo n.º 8
0
 public void a(NBTTagCompound nbttagcompound) {
   super.a(nbttagcompound);
   if (nbttagcompound.hasKey("playerGameType")) {
     this.playerInteractManager.setGameMode(
         EnumGamemode.a(nbttagcompound.getInt("playerGameType")));
   }
   this.getBukkitEntity().readExtraData(nbttagcompound); // CraftBukkit
 }
Ejemplo n.º 9
0
 public void b(NBTTagCompound nbttagcompound) {
   super.b(nbttagcompound);
   nbttagcompound.setInt("blockId", this.a);
   nbttagcompound.setInt("blockData", this.b);
   nbttagcompound.setInt("facing", this.c);
   nbttagcompound.setFloat("progress", this.g);
   nbttagcompound.setBoolean("extending", this.d);
 }
Ejemplo n.º 10
0
 public void a(NBTTagCompound nbttagcompound) {
   super.a(nbttagcompound);
   this.a = nbttagcompound.getInt("blockId");
   this.b = nbttagcompound.getInt("blockData");
   this.c = nbttagcompound.getInt("facing");
   this.g = this.f = nbttagcompound.getFloat("progress");
   this.d = nbttagcompound.getBoolean("extending");
 }
Ejemplo n.º 11
0
 public void b(NBTTagCompound nbttagcompound) {
   b = ((int) (nbttagcompound.c("xTile")));
   c = ((int) (nbttagcompound.c("yTile")));
   d = ((int) (nbttagcompound.c("zTile")));
   e = nbttagcompound.b("inTile") & 0xff;
   a = nbttagcompound.b("shake") & 0xff;
   f = nbttagcompound.b("inGround") == 1;
 }
Ejemplo n.º 12
0
  /** Called when saving data. If overriding, remember to call this version */
  public void writeToNBT(NBTTagCompound root) {
    root.setString("World", mLocation.getWorld().getName());
    root.setDouble("X", mLocation.getX());
    root.setDouble("Y", mLocation.getY());
    root.setDouble("Z", mLocation.getZ());

    Util.writeItemStackToNBT(mHoverItemTemplate, root);
  }
Ejemplo n.º 13
0
 public void b(NBTTagCompound nbttagcompound) {
   super.b(nbttagcompound);
   nbttagcompound.setInt("blockId", Block.getId(this.a));
   nbttagcompound.setInt("blockData", this.i);
   nbttagcompound.setInt("facing", this.j);
   nbttagcompound.setFloat("progress", this.n);
   nbttagcompound.setBoolean("extending", this.k);
 }
Ejemplo n.º 14
0
 public NBTTagCompound toNBT() {
   NBTTagCompound tag = new NBTTagCompound();
   tag.setString("ModId", modId);
   tag.setString("ItemType", itemType);
   tag.setInt("ItemId", itemId);
   tag.setInt("ordinal", ordinal);
   return tag;
 }
Ejemplo n.º 15
0
 public void b(NBTTagCompound nbttagcompound) {
   nbttagcompound.setShort("xTile", (short) this.e);
   nbttagcompound.setShort("yTile", (short) this.f);
   nbttagcompound.setShort("zTile", (short) this.g);
   nbttagcompound.setByte("inTile", (byte) Block.b(this.h));
   nbttagcompound.setByte("inGround", (byte) (this.i ? 1 : 0));
   nbttagcompound.set("direction", this.a(new double[] {this.motX, this.motY, this.motZ}));
 }
Ejemplo n.º 16
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.º 17
0
 public void a(NBTTagCompound nbttagcompound) {
   if (nbttagcompound.b("foodLevel")) {
     this.a = nbttagcompound.e("foodLevel");
     this.d = nbttagcompound.e("foodTickTimer");
     this.b = nbttagcompound.g("foodSaturationLevel");
     this.c = nbttagcompound.g("foodExhaustionLevel");
   }
 }
Ejemplo n.º 18
0
 public void a(NBTTagCompound var1) {
   super.a(var1);
   this.color = var1.getInt("Base");
   this.patterns = var1.getList("Patterns", 10);
   this.h = null;
   this.i = null;
   this.j = null;
   this.g = true;
 }
Ejemplo n.º 19
0
 public void b(NBTTagCompound nbttagcompound) {
   nbttagcompound.setShort("xTile", (short) this.e);
   nbttagcompound.setShort("yTile", (short) this.f);
   nbttagcompound.setShort("zTile", (short) this.g);
   nbttagcompound.setByte("inTile", (byte) this.h);
   nbttagcompound.setByte("inGround", (byte) (this.i ? 1 : 0));
   // CraftBukkit - Fix direction being mismapped to invalid variables
   nbttagcompound.set("power", this.a(new double[] {this.dirX, this.dirY, this.dirZ}));
 }
 protected void c(NBTTagCompound var1) {
   for (int var2 = 0; var2 < 19; ++var2) {
     if (var1.hasOfType("slot_" + var2, 8)) {
       String var3 = var1.getString("slot_" + var2);
       class_awj var4 = this.c.b(var3);
       this.c.a(var2, var4);
     }
   }
 }
 public void write(NBTTagCompound var1) {
   super.write(var1);
   var1.put("Anger", (short) this.bs);
   if (this.bu != null) {
     var1.put("HurtBy", this.bu.toString());
   } else {
     var1.put("HurtBy", "");
   }
 }
Ejemplo n.º 22
0
  public static ItemStack a(ItemStack var0, class_acd var1) {
    MinecraftKey var2 = (MinecraftKey) class_acd.a.getKey(var1);
    if (var2 != null) {
      NBTTagCompound var3 = var0.hasTag() ? var0.getTag() : new NBTTagCompound();
      var3.put("Potion", var2.toString());
      var0.setTag(var3);
    }

    return var0;
  }
Ejemplo n.º 23
0
  public NBTTagCompound save(NBTTagCompound nbttagcompound) {
    nbttagcompound.setShort("id", (short) this.id);
    nbttagcompound.setByte("Count", (byte) this.count);
    nbttagcompound.setShort("Damage", (short) this.damage);
    if (this.tag != null) {
      nbttagcompound.set("tag", this.tag);
    }

    return nbttagcompound;
  }
 public void b(NBTTagCompound var1) {
   if (this.c == null) {
     b.warn("Tried to save scoreboard without having a scoreboard...");
   } else {
     var1.put((String) "Objectives", (NBTTag) this.b());
     var1.put((String) "PlayerScores", (NBTTag) this.e());
     var1.put((String) "Teams", (NBTTag) this.a());
     this.d(var1);
   }
 }
  CraftMetaBlockState(NBTTagCompound tag, Material material) {
    super(tag);
    this.material = material;

    if (tag.hasKeyOfType(BLOCK_ENTITY_TAG.NBT, 10)) {
      blockEntityTag = tag.getCompound(BLOCK_ENTITY_TAG.NBT);
    } else {
      blockEntityTag = null;
    }
  }
Ejemplo n.º 26
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");
    }
  }
Ejemplo n.º 27
0
  public void b(NBTTagCompound nbttagcompound) {
    super.b(nbttagcompound);
    nbttagcompound.setByte("SkullType", (byte) (this.a & 255));
    nbttagcompound.setByte("Rot", (byte) (this.i & 255));
    if (this.j != null) {
      NBTTagCompound nbttagcompound1 = new NBTTagCompound();

      GameProfileSerializer.a(nbttagcompound1, this.j);
      nbttagcompound.set("Owner", nbttagcompound1);
    }
  }
Ejemplo n.º 28
0
  @Override
  public void a(NBTTagCompound nbttagcompound) {
    super.a(nbttagcompound);
    if (nbttagcompound.hasKey("SkeletonType")) {
      byte b0 = nbttagcompound.getByte("SkeletonType");

      this.setSkeletonType(b0);
    }

    this.m();
  }
Ejemplo n.º 29
0
 public void a(NBTTagCompound nbttagcompound) {
   super.a(nbttagcompound);
   if (nbttagcompound.b("playerGameType")) {
     // XXX Check this, it was only the last call to this.c.a
     if (MinecraftServer.D().am()) {
       this.c.a(MinecraftServer.D().g());
     } else {
       this.c.a(EnumGameType.a(nbttagcompound.e("playerGameType")));
     }
   }
 }
Ejemplo n.º 30
0
  private NBTTagCompound getBukkitData() {
    NBTTagCompound result = getData();

    if (result != null) {
      if (!result.hasKey("bukkit")) {
        result.set("bukkit", new NBTTagCompound());
      }
      result = result.getCompound("bukkit");
    }

    return result;
  }