コード例 #1
0
 public void swingItem() {
   if (!isSwinging) {
     swingProgressInt = -1;
     isSwinging = true;
     EntityTracker entitytracker = mcServer.getEntityTracker(dimension);
     entitytracker.sendPacketToTrackedPlayers(this, new Packet18Animation(this, 1));
   }
 }
コード例 #2
0
 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));
   }
 }
コード例 #3
0
 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);
   }
 }
コード例 #4
0
 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;
 }
コード例 #5
0
 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();
 }
コード例 #6
0
 public void func_40109_c(Entity entity) {
   EntityTracker entitytracker = mcServer.getEntityTracker(dimension);
   entitytracker.sendPacketToTrackedPlayersAndTrackedEntity(
       this, new Packet18Animation(entity, 7));
 }
コード例 #7
0
 public void onCriticalHit(Entity entity) {
   EntityTracker entitytracker = mcServer.getEntityTracker(dimension);
   entitytracker.sendPacketToTrackedPlayersAndTrackedEntity(
       this, new Packet18Animation(entity, 6));
 }