public void setMyPet(MyPet myPet) { if (myPet != null) { super.setMyPet(myPet); final MySkeleton mySkeleton = (MySkeleton) myPet; final EntityMySkeleton entityMySkeleton = this; this.setWither(mySkeleton.isWither()); MyPetPlugin.getPlugin() .getServer() .getScheduler() .runTaskLater( MyPetPlugin.getPlugin(), new Runnable() { public void run() { if (mySkeleton.getStatus() == PetState.Here) { for (EquipmentSlot slot : EquipmentSlot.values()) { if (mySkeleton.getEquipment(slot) != null) { entityMySkeleton.setPetEquipment( slot.getSlotId(), mySkeleton.getEquipment(slot)); } } } } }, 5L); } }
public void setPetEquipment(int slot, ItemStack itemStack) { ((WorldServer) this.world) .getTracker() .a(this, new Packet5EntityEquipment(this.id, slot, itemStack)); ((MySkeleton) myPet).equipment.put(EquipmentSlot.getSlotById(slot), itemStack); }