if (npc.getItemInHand().getType() != Material.AIR) {
toAdd.add(items.get(0).createStack());
}
items.set(0, new ItemData(hand.getTypeId(), hand.getDurability()));
} else {
Armor armor = Armor.getArmorSlot(itemID);
if (armor != null) {
ItemStack armorItem = armor.get(npcInv);
if (armorItem != null && armorItem.getType() == Material.getMaterial(itemID)) {
Messaging.sendError(player, error);
return;
}
slot = armor.name().toLowerCase();
if (armorItem != null && armorItem.getType() != Material.AIR) {
toAdd.add(items.get(armor.getSlot() + 1).createStack());
}
items.set(armor.getSlot() + 1, new ItemData(hand.getTypeId(), hand.getDurability()));
} else {
if (Material.getMaterial(items.get(0).getID()) == Material.getMaterial(itemID)) {
Messaging.sendError(player, error);
return;
}