diff --git a/src/engine/gameManager/ForgeManager.java b/src/engine/gameManager/ForgeManager.java index 15596b37..dfa6b57d 100644 --- a/src/engine/gameManager/ForgeManager.java +++ b/src/engine/gameManager/ForgeManager.java @@ -78,7 +78,7 @@ public enum ForgeManager implements Runnable { // Create new set of in-memory only virtual items - forgeWorkerOrderBatch(workOrder); + forgeWorkOrderBatch(workOrder); // enQueue this workOrder again; back into the oven // until all items for this workOrder are completed. @@ -146,7 +146,7 @@ public enum ForgeManager implements Runnable { // Create in-memory items and add to collections - forgeWorkerOrderBatch(workOrder); + forgeWorkOrderBatch(workOrder); Logger.info(workOrder.toString()); forge.add(workOrder); @@ -260,20 +260,6 @@ public enum ForgeManager implements Runnable { return forgedItem; } - public static void applyItemEffects(Item forgedItem) { - - if (forgedItem.prefixToken != 0) { - EffectsBase prefix = PowersManager.getEffectByToken(forgedItem.prefixToken); - forgedItem.addPermanentEnchantment(prefix.getIDString(), 0); - } - - if (forgedItem.suffixToken != 0) { - EffectsBase suffix = PowersManager.getEffectByToken(forgedItem.suffixToken); - forgedItem.addPermanentEnchantment(suffix.getIDString(), 0); - } - - } - public static void completeWorkOrderBatch(WorkOrder workOrder) { ArrayList toRemove = new ArrayList<>(); @@ -293,7 +279,7 @@ public enum ForgeManager implements Runnable { completedItem.prefixToken = workOrderItem.prefixToken; completedItem.suffixToken = workOrderItem.suffixToken; - applyItemEffects(completedItem); + ItemManager.applyItemEffects(completedItem); // add to the vendor inventory @@ -323,7 +309,7 @@ public enum ForgeManager implements Runnable { } } - public static void forgeWorkerOrderBatch(WorkOrder workOrder) { + public static void forgeWorkOrderBatch(WorkOrder workOrder) { // New completion time for this batch diff --git a/src/engine/gameManager/ItemManager.java b/src/engine/gameManager/ItemManager.java index fc461cb2..83e8213f 100644 --- a/src/engine/gameManager/ItemManager.java +++ b/src/engine/gameManager/ItemManager.java @@ -3,6 +3,7 @@ package engine.gameManager; import engine.loot.WorkOrder; import engine.mbEnums; import engine.objects.*; +import engine.powers.EffectsBase; import engine.powers.poweractions.AbstractPowerAction; import org.pmw.tinylog.Logger; @@ -260,4 +261,18 @@ public enum ItemManager { return validation_result; } + + public static void applyItemEffects(Item forgedItem) { + + if (forgedItem.prefixToken != 0) { + EffectsBase prefix = PowersManager.getEffectByToken(forgedItem.prefixToken); + forgedItem.addPermanentEnchantment(prefix.getIDString(), 0); + } + + if (forgedItem.suffixToken != 0) { + EffectsBase suffix = PowersManager.getEffectByToken(forgedItem.suffixToken); + forgedItem.addPermanentEnchantment(suffix.getIDString(), 0); + } + + } } diff --git a/src/engine/net/client/handlers/ItemProductionMsgHandler.java b/src/engine/net/client/handlers/ItemProductionMsgHandler.java index 0dfdfd3f..f4984f13 100644 --- a/src/engine/net/client/handlers/ItemProductionMsgHandler.java +++ b/src/engine/net/client/handlers/ItemProductionMsgHandler.java @@ -13,6 +13,7 @@ import engine.exception.MsgSendException; import engine.gameManager.ChatManager; import engine.gameManager.DbManager; import engine.gameManager.ForgeManager; +import engine.gameManager.ItemManager; import engine.loot.WorkOrder; import engine.mbEnums; import engine.mbEnums.ItemType; @@ -159,7 +160,7 @@ public class ItemProductionMsgHandler extends AbstractClientMsgHandler { completedItem.prefixToken = virtualItem.prefixToken; completedItem.suffixToken = virtualItem.suffixToken; - ForgeManager.applyItemEffects(completedItem); + ItemManager.applyItemEffects(completedItem); vendor.charItemManager.addItemToInventory(completedItem);