public void swingItem() {
   if (!isSwinging) {
     swingProgressInt = -1;
     isSwinging = true;
     EntityTracker entitytracker = mcServer.getEntityTracker(dimension);
     entitytracker.sendPacketToTrackedPlayers(this, new Packet18Animation(this, 1));
   }
 }
 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 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;
 }