Start mobequip refactor

This commit is contained in:
2024-03-18 10:01:29 -04:00
parent 0590ae64e7
commit 61c4cb1361
56 changed files with 198 additions and 377 deletions
+7 -12
View File
@@ -52,7 +52,6 @@ public class NPC extends AbstractCharacter {
private final ArrayList<MobLoot> rolling = new ArrayList<>();
public ReentrantReadWriteLock minionLock = new ReentrantReadWriteLock();
public ArrayList<ProducedItem> forgedItems = new ArrayList<>();
public HashMap<Enum.EquipSlotType, Item> equip = null;
public int runeSetID = 0;
public int extraRune2 = 0;
protected int loadID;
@@ -341,11 +340,11 @@ public class NPC extends AbstractCharacter {
// get a copy of the equipped items.
if (npc.equip != null) {
writer.putInt(npc.equip.size());
if (npc.charItemManager.equipped.isEmpty() == false) {
writer.putInt(npc.charItemManager.equipped.size());
for (Item me : npc.equip.values())
Item.serializeForClientMsg(me, writer);
for (Item me : npc.charItemManager.equipped.values())
Item._serializeForClientMsg(me, writer);
} else
writer.putInt(0);
@@ -913,7 +912,7 @@ public class NPC extends AbstractCharacter {
if (equipmentSetID != 0 && LootManager._bootySetMap.get(equipmentSetID) == null)
Logger.error("Invalid equipSet: " + equipmentSetID + " contract: " + this.contractUUID + " npc: " + this.getObjectUUID());
this.equip = loadEquipmentSet(this.equipmentSetID);
this.charItemManager.equipped = loadEquipmentSet(this.equipmentSetID);
try {
@@ -1241,7 +1240,7 @@ public class NPC extends AbstractCharacter {
if (targetItem == null)
return false;
if (!this.getCharItemManager().forgeContains(targetItem, this))
if (!this.charItemManager.forgeContains(targetItem, this))
return false;
if (!DbManager.NPCQueries.UPDATE_ITEM_TO_INVENTORY(targetItem.getObjectUUID(), currentID))
@@ -1250,7 +1249,7 @@ public class NPC extends AbstractCharacter {
targetItem.setIsID(true);
this.rolling.remove(targetItem);
this.getCharItemManager().addItemToInventory(targetItem);
this.charItemManager.addItemToInventory(targetItem);
//remove from client forge window
@@ -1265,10 +1264,6 @@ public class NPC extends AbstractCharacter {
return true;
}
public HashMap<Enum.EquipSlotType, Item> getEquip() {
return equip;
}
public int getEquipmentSetID() {
return equipmentSetID;
}