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"); } }
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 }