Exemple #1
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);
  }
  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");
    }
  }
  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));
    }
  }
Exemple #4
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");
 }
 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");
 }
Exemple #6
0
 public void a(NBTTagCompound nbttagcompound) {
   this.e = nbttagcompound.getShort("xTile");
   this.f = nbttagcompound.getShort("yTile");
   this.g = nbttagcompound.getShort("zTile");
   this.h = nbttagcompound.getByte("inTile") & 255;
   this.i = nbttagcompound.getByte("inData") & 255;
   this.shake = nbttagcompound.getByte("shake") & 255;
   this.inGround = nbttagcompound.getByte("inGround") == 1;
   this.fromPlayer = nbttagcompound.getBoolean("player");
 }
  public void a(NBTTagCompound nbttagcompound) {
    super.a(nbttagcompound);
    this.o(nbttagcompound.getBoolean("EatingHaystack"));
    this.k(nbttagcompound.getBoolean("Bred"));
    this.setHasChest(nbttagcompound.getBoolean("ChestedHorse"));
    this.m(nbttagcompound.getBoolean("HasReproduced"));
    this.setType(nbttagcompound.getInt("Type"));
    this.setVariant(nbttagcompound.getInt("Variant"));
    this.setTemper(nbttagcompound.getInt("Temper"));
    this.setTame(nbttagcompound.getBoolean("Tame"));
    if (nbttagcompound.hasKeyOfType("OwnerUUID", 8)) {
      this.setOwnerUUID(nbttagcompound.getString("OwnerUUID"));
    }
    // CraftBukkit start
    if (nbttagcompound.hasKey("Bukkit.MaxDomestication")) {
      this.maxDomestication = nbttagcompound.getInt("Bukkit.MaxDomestication");
    }
    // CraftBukkit end
    AttributeInstance attributeinstance = this.bb().a("Speed");

    if (attributeinstance != null) {
      this.getAttributeInstance(GenericAttributes.d).setValue(attributeinstance.b() * 0.25D);
    }

    if (this.hasChest()) {
      NBTTagList nbttaglist = nbttagcompound.getList("Items", 10);

      this.loadChest();

      for (int i = 0; i < nbttaglist.size(); ++i) {
        NBTTagCompound nbttagcompound1 = nbttaglist.get(i);
        int j = nbttagcompound1.getByte("Slot") & 255;

        if (j >= 2 && j < this.inventoryChest.getSize()) {
          this.inventoryChest.setItem(j, ItemStack.createStack(nbttagcompound1));
        }
      }
    }

    ItemStack itemstack;

    if (nbttagcompound.hasKeyOfType("ArmorItem", 10)) {
      itemstack = ItemStack.createStack(nbttagcompound.getCompound("ArmorItem"));
      if (itemstack != null && a(itemstack.getItem())) {
        this.inventoryChest.setItem(1, itemstack);
      }
    }

    if (nbttagcompound.hasKeyOfType("SaddleItem", 10)) {
      itemstack = ItemStack.createStack(nbttagcompound.getCompound("SaddleItem"));
      if (itemstack != null && itemstack.getItem() == Items.SADDLE) {
        this.inventoryChest.setItem(0, itemstack);
      }
    } else if (nbttagcompound.getBoolean("Saddle")) {
      this.inventoryChest.setItem(0, new ItemStack(Items.SADDLE));
    }

    this.cO();
  }
  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"));
      }
    }
  }
  public void a(NBTTagCompound nbttagcompound) {
    this.d = nbttagcompound.getShort("xTile");
    this.e = nbttagcompound.getShort("yTile");
    this.f = nbttagcompound.getShort("zTile");
    this.g = nbttagcompound.getByte("inTile") & 255;
    this.h = nbttagcompound.getByte("inData") & 255;
    this.shake = nbttagcompound.getByte("shake") & 255;
    this.inGround = nbttagcompound.getByte("inGround") == 1;
    if (nbttagcompound.hasKey("damage")) {
      this.damage = nbttagcompound.getDouble("damage");
    }

    if (nbttagcompound.hasKey("pickup")) {
      this.fromPlayer = nbttagcompound.getByte("pickup");
    } else if (nbttagcompound.hasKey("player")) {
      this.fromPlayer = nbttagcompound.getBoolean("player") ? 1 : 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));
        }
      }
    }
  }
 public void a(NBTTagCompound nbttagcompound) {
   super.a(nbttagcompound);
   this.setPlayerCreated(nbttagcompound.getBoolean("PlayerCreated"));
 }
 protected void b(NBTTagCompound nbttagcompound) {
   super.b(nbttagcompound);
   this.b = nbttagcompound.getBoolean("Chest");
 }
Exemple #13
0
 public void a(NBTTagCompound nbttagcompound) {
   super.a(nbttagcompound);
   this.setSheared(nbttagcompound.getBoolean("Sheared"));
   this.setColor(nbttagcompound.getByte("Color"));
 }
 public void read(NBTTagCompound var1) {
   super.read(var1);
   this.m(var1.getBoolean("PlayerCreated"));
 }
Exemple #15
0
  public void f(NBTTagCompound nbttagcompound) {
    try {
      NBTTagList nbttaglist = nbttagcompound.getList("Pos", 6);
      NBTTagList nbttaglist1 = nbttagcompound.getList("Motion", 6);
      NBTTagList nbttaglist2 = nbttagcompound.getList("Rotation", 5);

      this.motX = nbttaglist1.d(0);
      this.motY = nbttaglist1.d(1);
      this.motZ = nbttaglist1.d(2);
      if (Math.abs(this.motX) > 10.0D) {
        this.motX = 0.0D;
      }

      if (Math.abs(this.motY) > 10.0D) {
        this.motY = 0.0D;
      }

      if (Math.abs(this.motZ) > 10.0D) {
        this.motZ = 0.0D;
      }

      this.lastX = this.P = this.locX = nbttaglist.d(0);
      this.lastY = this.Q = this.locY = nbttaglist.d(1);
      this.lastZ = this.R = this.locZ = nbttaglist.d(2);
      this.lastYaw = this.yaw = nbttaglist2.e(0);
      this.lastPitch = this.pitch = nbttaglist2.e(1);
      this.fallDistance = nbttagcompound.getFloat("FallDistance");
      this.fireTicks = nbttagcompound.getShort("Fire");
      this.setAirTicks(nbttagcompound.getShort("Air"));
      this.onGround = nbttagcompound.getBoolean("OnGround");
      this.dimension = nbttagcompound.getInt("Dimension");
      this.invulnerable = nbttagcompound.getBoolean("Invulnerable");
      this.portalCooldown = nbttagcompound.getInt("PortalCooldown");
      if (nbttagcompound.hasKeyOfType("UUIDMost", 4)
          && nbttagcompound.hasKeyOfType("UUIDLeast", 4)) {
        this.uniqueID =
            new UUID(nbttagcompound.getLong("UUIDMost"), nbttagcompound.getLong("UUIDLeast"));
      } else if (nbttagcompound.hasKeyOfType("UUID", 8)) {
        this.uniqueID = UUID.fromString(nbttagcompound.getString("UUID"));
      }

      this.setPosition(this.locX, this.locY, this.locZ);
      this.setYawPitch(this.yaw, this.pitch);
      if (nbttagcompound.hasKeyOfType("CustomName", 8)
          && nbttagcompound.getString("CustomName").length() > 0) {
        this.setCustomName(nbttagcompound.getString("CustomName"));
      }

      this.setCustomNameVisible(nbttagcompound.getBoolean("CustomNameVisible"));
      this.as.a(nbttagcompound);
      this.b(nbttagcompound.getBoolean("Silent"));
      this.a(nbttagcompound);
      if (this.af()) {
        this.setPosition(this.locX, this.locY, this.locZ);
      }

    } catch (Throwable throwable) {
      CrashReport crashreport = CrashReport.a(throwable, "Loading entity NBT");
      CrashReportSystemDetails crashreportsystemdetails = crashreport.a("Entity being loaded");

      this.appendEntityCrashDetails(crashreportsystemdetails);
      throw new ReportedException(crashreport);
    }
  }
Exemple #16
0
 public void a(NBTTagCompound nbttagcompound) {
   super.a(nbttagcompound);
   this.setSaddle(nbttagcompound.getBoolean("Saddle"));
 }
  public class_apc(WorldServer var1, NBTTagCompound var2) {
    this.c =
        new class_le(
            new ChatMessage("entity.EnderDragon.name", new Object[0]),
            class_oh.class_a_in_class_oh.a,
            class_oh.class_b_in_class_oh.a,
            false,
            true);
    this.e = Lists.newArrayList();
    this.g = 0;
    this.h = 0;
    this.i = 0;
    this.j = 0;
    this.k = false;
    this.l = false;
    this.m = null;
    this.n = false;
    this.d = var1;
    if (var2.hasOfType("DragonKilled", 1)) {
      this.m = var2.getUUID("DragonUUID");
      this.k = var2.getBoolean("DragonKilled");
      this.l = var2.getBoolean("PreviouslyKilled");
    } else {
      this.n = true;
      this.k = true;
      this.l = true;
    }

    if (var2.hasOfType("Gateways", 9)) {
      NBTTagList var3 = var2.getList("Gateways", 3);

      for (int var4 = 0; var4 < var3.getSize(); ++var4) {
        this.e.add(Integer.valueOf(var3.getInt(var4)));
      }
    } else {
      this.e.addAll(
          ContiguousSet.create(
              Range.closedOpen(Integer.valueOf(0), Integer.valueOf(20)),
              DiscreteDomain.integers()));
      Collections.shuffle(this.e, new Random(var1.K()));
    }

    this.f =
        class_anq
            .a()
            .a(
                new String[] {
                  "       ", "       ", "       ", "   #   ", "       ", "       ", "       "
                })
            .a(
                new String[] {
                  "       ", "       ", "       ", "   #   ", "       ", "       ", "       "
                })
            .a(
                new String[] {
                  "       ", "       ", "       ", "   #   ", "       ", "       ", "       "
                })
            .a(
                new String[] {
                  "  ###  ", " #   # ", "#     #", "#  #  #", "#     #", " #   # ", "  ###  "
                })
            .a(
                new String[] {
                  "       ", "  ###  ", " ##### ", " ##### ", " ##### ", "  ###  ", "       "
                })
            .a('#', class_ano.a(class_ans.a(Blocks.BEDROCK)))
            .b();
  }
 protected void b(NBTTagCompound nbttagcompound) {
   super.b(nbttagcompound);
   this.a = nbttagcompound.getBoolean("Source");
 }