Browse Source

More itembase refactor work

combat-2
MagicBot 8 months ago
parent
commit
109ddde0a8
  1. 4
      src/engine/gameManager/BuildingManager.java
  2. 4
      src/engine/objects/Item.java

4
src/engine/gameManager/BuildingManager.java

@ -207,14 +207,12 @@ public enum BuildingManager {
return false; return false;
} }
ItemBase elanIB = ItemBase.getItemBase(1705032);
ItemTemplate template = ItemTemplate.itemTemplates.get(1705032); // Elan Stone ItemTemplate template = ItemTemplate.itemTemplates.get(1705032); // Elan Stone
if (!player.getCharItemManager().hasRoomInventory(template.item_wt)) if (!player.getCharItemManager().hasRoomInventory(template.item_wt))
return false; return false;
if (!Item.MakeItemForPlayer(elanIB, player, amount)) if (!Item.MakeItemForPlayer(template.template_id, player, amount))
return false; return false;
shrine.setFavors(0); shrine.setFavors(0);

4
src/engine/objects/Item.java

@ -353,11 +353,11 @@ public class Item extends AbstractWorldObject {
} }
public static boolean MakeItemForPlayer(ItemBase toCreate, PlayerCharacter reciever, int amount) { public static boolean MakeItemForPlayer(int templateID, PlayerCharacter reciever, int amount) {
boolean itemWorked = false; boolean itemWorked = false;
Item item = new Item(toCreate.getUUID()); Item item = new Item(templateID);
item.ownerID = reciever.getObjectUUID(); item.ownerID = reciever.getObjectUUID();
item.ownerType = OwnerType.PlayerCharacter; item.ownerType = OwnerType.PlayerCharacter;

Loading…
Cancel
Save