From 109ddde0a88b4a2b736f0e676e69cc16562d8738 Mon Sep 17 00:00:00 2001 From: MagicBot Date: Fri, 15 Mar 2024 13:31:24 -0400 Subject: [PATCH] More itembase refactor work --- src/engine/gameManager/BuildingManager.java | 4 +--- src/engine/objects/Item.java | 4 ++-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/engine/gameManager/BuildingManager.java b/src/engine/gameManager/BuildingManager.java index d1f24b9a..ae9fc246 100644 --- a/src/engine/gameManager/BuildingManager.java +++ b/src/engine/gameManager/BuildingManager.java @@ -207,14 +207,12 @@ public enum BuildingManager { return false; } - ItemBase elanIB = ItemBase.getItemBase(1705032); - ItemTemplate template = ItemTemplate.itemTemplates.get(1705032); // Elan Stone if (!player.getCharItemManager().hasRoomInventory(template.item_wt)) return false; - if (!Item.MakeItemForPlayer(elanIB, player, amount)) + if (!Item.MakeItemForPlayer(template.template_id, player, amount)) return false; shrine.setFavors(0); diff --git a/src/engine/objects/Item.java b/src/engine/objects/Item.java index 1f43d1bb..64e87ac0 100644 --- a/src/engine/objects/Item.java +++ b/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; - Item item = new Item(toCreate.getUUID()); + Item item = new Item(templateID); item.ownerID = reciever.getObjectUUID(); item.ownerType = OwnerType.PlayerCharacter;