Begin constructor refactor

This commit is contained in:
2024-03-01 21:32:51 -05:00
parent 9ea44d7e1c
commit fa440e2885
20 changed files with 72 additions and 76 deletions
+7 -6
View File
@@ -37,9 +37,10 @@ public class MakeItemCmd extends AbstractDevCmd {
if (ibID == 7)
continue;
ItemBase ib = ItemBase.getItemBase(ibID);
ItemTemplate template = ItemTemplate.itemTemplates.get(ibID);
int weight = template.item_wt;
short weight = ib.getWeight();
if (!pc.getCharItemManager().hasRoomInventory(weight)) {
throwbackError(pc, "Not enough room in inventory for any more of this item");
@@ -48,10 +49,10 @@ public class MakeItemCmd extends AbstractDevCmd {
}
boolean worked = false;
Item item = new Item(ib, pc.getObjectUUID(),
OwnerType.PlayerCharacter, (byte) 0, (byte) 0, (short) ib.getDurability(), (short) ib.getDurability(),
true, false, ItemContainerType.INVENTORY, (byte) 0,
new ArrayList<>(), "");
Item item = new Item(template.template_id);
item.ownerID = pc.getObjectUUID();
item.ownerType = OwnerType.PlayerCharacter;
item.containerType = ItemContainerType.INVENTORY;
item.setNumOfItems(Warehouse.getMaxResources().get(ibID));