public void swingItem() {
   if (!isSwinging) {
     swingProgressInt = -1;
     isSwinging = true;
     EntityTracker entitytracker = mcServer.getEntityTracker(dimension);
     entitytracker.sendPacketToTrackedPlayers(this, new Packet18Animation(this, 1));
   }
 }
 public void setItemInUse(ItemStack itemstack, int i) {
   super.setItemInUse(itemstack, i);
   if (itemstack != null
       && itemstack.getItem() != null
       && itemstack.getItem().getAction(itemstack) == EnumAction.eat) {
     EntityTracker entitytracker = mcServer.getEntityTracker(dimension);
     entitytracker.sendPacketToTrackedPlayersAndTrackedEntity(
         this, new Packet18Animation(this, 5));
   }
 }
 public void wakeUpPlayer(boolean flag, boolean flag1, boolean flag2) {
   if (isPlayerSleeping()) {
     EntityTracker entitytracker = mcServer.getEntityTracker(dimension);
     entitytracker.sendPacketToTrackedPlayersAndTrackedEntity(
         this, new Packet18Animation(this, 3));
   }
   super.wakeUpPlayer(flag, flag1, flag2);
   if (playerNetServerHandler != null) {
     playerNetServerHandler.teleportTo(posX, posY, posZ, rotationYaw, rotationPitch);
   }
 }
 public EnumStatus sleepInBedAt(int i, int j, int k) {
   EnumStatus enumstatus = super.sleepInBedAt(i, j, k);
   if (enumstatus == EnumStatus.OK) {
     EntityTracker entitytracker = mcServer.getEntityTracker(dimension);
     Packet17Sleep packet17sleep = new Packet17Sleep(this, 0, i, j, k);
     entitytracker.sendPacketToTrackedPlayers(this, packet17sleep);
     playerNetServerHandler.teleportTo(posX, posY, posZ, rotationYaw, rotationPitch);
     playerNetServerHandler.sendPacket(packet17sleep);
   }
   return enumstatus;
 }
 public void onUpdate() {
   itemInWorldManager.updateBlockRemoving();
   ticksOfInvuln--;
   currentCraftingInventory.updateCraftingResults();
   for (int i = 0; i < 5; i++) {
     ItemStack itemstack = getEquipmentInSlot(i);
     if (itemstack != playerInventory[i]) {
       mcServer
           .getEntityTracker(dimension)
           .sendPacketToTrackedPlayers(this, new Packet5PlayerInventory(entityId, i, itemstack));
       playerInventory[i] = itemstack;
     }
   }
 }
 public void onItemPickup(Entity entity, int i) {
   if (!entity.isDead) {
     EntityTracker entitytracker = mcServer.getEntityTracker(dimension);
     if (entity instanceof EntityItem) {
       entitytracker.sendPacketToTrackedPlayers(
           entity, new Packet22Collect(entity.entityId, entityId));
     }
     if (entity instanceof EntityArrow) {
       entitytracker.sendPacketToTrackedPlayers(
           entity, new Packet22Collect(entity.entityId, entityId));
     }
     if (entity instanceof EntityXPOrb) {
       entitytracker.sendPacketToTrackedPlayers(
           entity, new Packet22Collect(entity.entityId, entityId));
     }
   }
   super.onItemPickup(entity, i);
   currentCraftingInventory.updateCraftingResults();
 }
 public void func_40109_c(Entity entity) {
   EntityTracker entitytracker = mcServer.getEntityTracker(dimension);
   entitytracker.sendPacketToTrackedPlayersAndTrackedEntity(
       this, new Packet18Animation(entity, 7));
 }
 public void onCriticalHit(Entity entity) {
   EntityTracker entitytracker = mcServer.getEntityTracker(dimension);
   entitytracker.sendPacketToTrackedPlayersAndTrackedEntity(
       this, new Packet18Animation(entity, 6));
 }