Esempio n. 1
0
  public void e(NBTTagCompound nbttagcompound) {
    NBTTagList nbttaglist = nbttagcompound.k("Pos");
    NBTTagList nbttaglist1 = nbttagcompound.k("Motion");
    NBTTagList nbttaglist2 = nbttagcompound.k("Rotation");

    a(0.0D, 0.0D, 0.0D);
    s = ((NBTTagDouble) nbttaglist1.a(0)).a;
    t = ((NBTTagDouble) nbttaglist1.a(1)).a;
    u = ((NBTTagDouble) nbttaglist1.a(2)).a;
    m = O = p = ((NBTTagDouble) nbttaglist.a(0)).a;
    n = P = q = ((NBTTagDouble) nbttaglist.a(1)).a;
    o = Q = r = ((NBTTagDouble) nbttaglist.a(2)).a;
    x = v = ((NBTTagFloat) nbttaglist2.a(0)).a;
    y = w = ((NBTTagFloat) nbttaglist2.a(1)).a;
    N = nbttagcompound.f("FallDistance");
    Z = nbttagcompound.c("Fire");
    ad = nbttagcompound.c("Air");
    A = nbttagcompound.l("OnGround");
    a(p, q, r);
    b(nbttagcompound);
  }
Esempio n. 2
0
  protected NBTTagList a(float af1[]) {
    NBTTagList nbttaglist = new NBTTagList();
    float af2[] = af1;
    int i1 = af2.length;

    for (int j1 = 0; j1 < i1; j1++) {
      float f1 = af2[j1];

      nbttaglist.a(new NBTTagFloat(f1));
    }

    return nbttaglist;
  }
Esempio n. 3
0
  protected NBTTagList a(double ad1[]) {
    NBTTagList nbttaglist = new NBTTagList();
    double ad2[] = ad1;
    int i1 = ad2.length;

    for (int j1 = 0; j1 < i1; j1++) {
      double d1 = ad2[j1];

      nbttaglist.a(new NBTTagDouble(d1));
    }

    return nbttaglist;
  }
Esempio n. 4
0
  protected NBTTagList a(float... afloat) {
    NBTTagList nbttaglist = new NBTTagList();
    float[] afloat1 = afloat;
    int i = afloat.length;

    for (int j = 0; j < i; ++j) {
      float f = afloat1[j];

      nbttaglist.a((NBTBase) (new NBTTagFloat(f)));
    }

    return nbttaglist;
  }
Esempio n. 5
0
  protected NBTTagList a(double... adouble) {
    NBTTagList nbttaglist = new NBTTagList();
    double[] adouble1 = adouble;
    int i = adouble.length;

    for (int j = 0; j < i; ++j) {
      double d0 = adouble1[j];

      nbttaglist.a((NBTBase) (new NBTTagDouble(d0)));
    }

    return nbttaglist;
  }
  protected void b(NBTTagCompound nbttagcompound) {
    super.b(nbttagcompound);
    NBTTagList nbttaglist = new NBTTagList();

    for (int i0 = 0; i0 < this.a.length; ++i0) {
      if (this.a[i0] != null) {
        NBTTagCompound nbttagcompound1 = new NBTTagCompound();

        nbttagcompound1.a("Slot", (byte) i0);
        this.a[i0].b(nbttagcompound1);
        nbttaglist.a((NBTBase) nbttagcompound1);
      }
    }

    nbttagcompound.a("Items", (NBTBase) nbttaglist);
  }
Esempio n. 7
0
  public void b(NBTTagCompound nbttagcompound) {
    super.b(nbttagcompound);
    nbttagcompound.a("BurnTime", (short) e);
    nbttagcompound.a("CookTime", (short) g);
    NBTTagList nbttaglist = new NBTTagList();

    for (int j = 0; j < h.length; j++) {
      if (h[j] != null) {
        NBTTagCompound nbttagcompound1 = new NBTTagCompound();

        nbttagcompound1.a("Slot", (byte) j);
        h[j].a(nbttagcompound1);
        nbttaglist.a(((NBTBase) (nbttagcompound1)));
      }
    }

    nbttagcompound.a("Items", ((NBTBase) (nbttaglist)));
  }
Esempio n. 8
0
  public void a(NBTTagCompound nbttagcompound) {
    super.a(nbttagcompound);
    NBTTagList nbttaglist = nbttagcompound.k("Items");

    h = new ItemStack[h_()];
    for (int j = 0; j < nbttaglist.b(); j++) {
      NBTTagCompound nbttagcompound1 = (NBTTagCompound) nbttaglist.a(j);
      byte byte0 = nbttagcompound1.b("Slot");

      if (byte0 >= 0 && byte0 < h.length) {
        h[byte0] = new ItemStack(nbttagcompound1);
      }
    }

    e = ((int) (nbttagcompound.c("BurnTime")));
    g = ((int) (nbttagcompound.c("CookTime")));
    f = a(h[1]);
  }
  public void b(NBTTagCompound nbttagcompound) {
    super.b(nbttagcompound);
    NBTTagList nbttaglist = new NBTTagList();

    for (int i0 = 0; i0 < this.i.length; ++i0) {
      if (this.i[i0] != null) {
        NBTTagCompound nbttagcompound1 = new NBTTagCompound();

        nbttagcompound1.a("Slot", (byte) i0);
        this.i[i0].b(nbttagcompound1);
        nbttaglist.a((NBTBase) nbttagcompound1);
      }
    }

    nbttagcompound.a("Items", (NBTBase) nbttaglist);
    if (this.c()) {
      nbttagcompound.a("CustomName", this.s);
    }
  }
Esempio n. 10
0
  public void e(NBTTagCompound nbttagcompound) {
    NBTTagList nbttaglist = nbttagcompound.l("Pos");
    NBTTagList nbttaglist1 = nbttagcompound.l("Motion");
    NBTTagList nbttaglist2 = nbttagcompound.l("Rotation");

    this.motX = ((NBTTagDouble) nbttaglist1.a(0)).a;
    this.motY = ((NBTTagDouble) nbttaglist1.a(1)).a;
    this.motZ = ((NBTTagDouble) nbttaglist1.a(2)).a;
    /* CraftBukkit start - moved section down
    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;
    }
    // CraftBukkit end */

    this.lastX = this.bo = this.locX = ((NBTTagDouble) nbttaglist.a(0)).a;
    this.lastY = this.bp = this.locY = ((NBTTagDouble) nbttaglist.a(1)).a;
    this.lastZ = this.bq = this.locZ = ((NBTTagDouble) nbttaglist.a(2)).a;
    this.lastYaw = this.yaw = ((NBTTagFloat) nbttaglist2.a(0)).a;
    this.lastPitch = this.pitch = ((NBTTagFloat) nbttaglist2.a(1)).a;
    this.fallDistance = nbttagcompound.g("FallDistance");
    this.fireTicks = nbttagcompound.d("Fire");
    this.airTicks = nbttagcompound.d("Air");
    this.onGround = nbttagcompound.m("OnGround");
    this.setPosition(this.locX, this.locY, this.locZ);

    // CraftBukkit start
    long least = nbttagcompound.f("UUIDLeast");
    long most = nbttagcompound.f("UUIDMost");

    if (least != 0L && most != 0L) {
      this.uniqueId = new UUID(most, least);
    }
    // CraftBukkit end

    this.c(this.yaw, this.pitch);
    this.a(nbttagcompound);

    // CraftBukkit start - Exempt Vehicles from notch's sanity check
    if (!(this.getBukkitEntity() instanceof CraftVehicle)) {
      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;
      }
    }
    // CraftBukkit end

    // CraftBukkit Start - reset world
    CraftWorld world = null;
    if (this instanceof EntityPlayer) {
      EntityPlayer entityPlayer = (EntityPlayer) this;
      String worldName = nbttagcompound.getString("World");
      if (worldName == "") {
        world = ((CraftServer) Bukkit.getServer()).getServer().a(entityPlayer.dimension).getWorld();
      } else {
        world = (CraftWorld) Bukkit.getServer().getWorld(worldName);
      }
    } else {
      world = (CraftWorld) Bukkit.getServer().getWorld(nbttagcompound.getString("World"));
    }

    a(world == null ? null : world.getHandle());
    // CraftBukkit End
  }