forked from MagicBane/Server
Warehosue cleanup
This commit is contained in:
@@ -131,7 +131,7 @@ public class ItemFactory {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (overdraft > 0 && WarehouseManager.isResourceLocked(cityWarehouse, ItemBase.GOLD_ITEM_BASE)) {
|
||||
if (overdraft > 0 && Warehouse.isResourceLocked(cityWarehouse, ItemBase.GOLD_ITEM_BASE)) {
|
||||
if (pc != null)
|
||||
ErrorPopupMsg.sendErrorMsg(pc, "Warehouse gold is barred! Overdraft cannot be withdrawn from warehouse." + " " + ib.getName());
|
||||
return null;
|
||||
@@ -167,7 +167,7 @@ public class ItemFactory {
|
||||
}
|
||||
|
||||
if (overdraft > 0)
|
||||
if (!WarehouseManager.withdraw(cityWarehouse, npc, ItemBase.GOLD_ITEM_BASE, overdraft, true)) {
|
||||
if (!Warehouse.withdraw(cityWarehouse, npc, ItemBase.GOLD_ITEM_BASE, overdraft, true)) {
|
||||
//ChatManager.chatGuildError(pc, "Failed to create Item");
|
||||
Logger.error("Warehouse With UID of " + cityWarehouse.UID + " Failed to Create Item." + ib.getName());
|
||||
return null;
|
||||
@@ -263,7 +263,7 @@ public class ItemFactory {
|
||||
}
|
||||
|
||||
if (galvorAmount > 0) {
|
||||
if (WarehouseManager.isResourceLocked(cityWarehouse, galvor)) {
|
||||
if (Warehouse.isResourceLocked(cityWarehouse, galvor)) {
|
||||
if (pc != null)
|
||||
ErrorPopupMsg.sendErrorMsg(pc, "Galvor is locked." + ib.getName());
|
||||
return null;
|
||||
@@ -277,7 +277,7 @@ public class ItemFactory {
|
||||
}
|
||||
|
||||
if (wormwoodAmount > 0) {
|
||||
if (WarehouseManager.isResourceLocked(cityWarehouse, wormwood)) {
|
||||
if (Warehouse.isResourceLocked(cityWarehouse, wormwood)) {
|
||||
if (pc != null)
|
||||
ErrorPopupMsg.sendErrorMsg(pc, "Wormwood is locked." + ib.getName());
|
||||
return null;
|
||||
@@ -320,7 +320,7 @@ public class ItemFactory {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (overdraft > 0 && WarehouseManager.isResourceLocked(cityWarehouse, ItemBase.GOLD_ITEM_BASE)) {
|
||||
if (overdraft > 0 && Warehouse.isResourceLocked(cityWarehouse, ItemBase.GOLD_ITEM_BASE)) {
|
||||
if (pc != null)
|
||||
ErrorPopupMsg.sendErrorMsg(pc, "Warehouse gold is barred! Overdraft cannot be withdrawn from warehouse." + ib.getName());
|
||||
return null;
|
||||
@@ -374,7 +374,7 @@ public class ItemFactory {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (overdraft > 0 && WarehouseManager.isResourceLocked(cityWarehouse, ItemBase.GOLD_ITEM_BASE)) {
|
||||
if (overdraft > 0 && Warehouse.isResourceLocked(cityWarehouse, ItemBase.GOLD_ITEM_BASE)) {
|
||||
if (pc != null)
|
||||
ErrorPopupMsg.sendErrorMsg(pc, "Warehouse gold is barred! Overdraft cannot be withdrawn from warehouse." + ib.getName());
|
||||
return null;
|
||||
@@ -414,7 +414,7 @@ public class ItemFactory {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (overdraft > 0 && useWarehouse && WarehouseManager.isResourceLocked(cityWarehouse, ItemBase.GOLD_ITEM_BASE)) {
|
||||
if (overdraft > 0 && useWarehouse && Warehouse.isResourceLocked(cityWarehouse, ItemBase.GOLD_ITEM_BASE)) {
|
||||
if (pc != null)
|
||||
ErrorPopupMsg.sendErrorMsg(pc, "Warehouse gold is barred! Overdraft cannot be withdrawn from warehouse." + ib.getName());
|
||||
return null;
|
||||
@@ -448,7 +448,7 @@ public class ItemFactory {
|
||||
}
|
||||
|
||||
if (overdraft > 0 && useWarehouse)
|
||||
if (!WarehouseManager.withdraw(cityWarehouse, npc, ItemBase.GOLD_ITEM_BASE, overdraft, true)) {
|
||||
if (!Warehouse.withdraw(cityWarehouse, npc, ItemBase.GOLD_ITEM_BASE, overdraft, true)) {
|
||||
//ChatManager.chatGuildError(pc, "Failed to create Item");
|
||||
Logger.error("Warehouse With UID of " + cityWarehouse.UID + " Failed to Create Item." + ib.getName());
|
||||
return null;
|
||||
@@ -467,7 +467,7 @@ public class ItemFactory {
|
||||
|
||||
int creationAmount = prefixResourceCosts.get(ibResources);
|
||||
|
||||
if (WarehouseManager.isResourceLocked(cityWarehouse, ibResources) == true)
|
||||
if (Warehouse.isResourceLocked(cityWarehouse, ibResources) == true)
|
||||
return null;
|
||||
|
||||
int oldAmount = cityWarehouse.resources.get(ibResources);
|
||||
@@ -476,7 +476,7 @@ public class ItemFactory {
|
||||
if (oldAmount < amount)
|
||||
amount = oldAmount;
|
||||
|
||||
if (!WarehouseManager.withdraw(cityWarehouse, npc, ibResources, amount, true)) {
|
||||
if (!Warehouse.withdraw(cityWarehouse, npc, ibResources, amount, true)) {
|
||||
//ChatManager.chatGuildError(pc, "Failed to create Item");
|
||||
Logger.error("Warehouse With UID of " + cityWarehouse.UID + " Failed to Create Item." + ib.getName());
|
||||
return null;
|
||||
@@ -489,7 +489,7 @@ public class ItemFactory {
|
||||
for (ItemBase ibResources : suffixResourceCosts.keySet()) {
|
||||
int creationAmount = suffixResourceCosts.get(ibResources);
|
||||
|
||||
if (WarehouseManager.isResourceLocked(cityWarehouse, ibResources) == true) {
|
||||
if (Warehouse.isResourceLocked(cityWarehouse, ibResources) == true) {
|
||||
ChatManager.chatSystemError(pc, ibResources.getName() + " is locked!" + ib.getName());
|
||||
return null;
|
||||
}
|
||||
@@ -498,7 +498,7 @@ public class ItemFactory {
|
||||
int amount = creationAmount;
|
||||
if (oldAmount < amount)
|
||||
amount = oldAmount;
|
||||
if (!WarehouseManager.withdraw(cityWarehouse, npc, ibResources, amount, true)) {
|
||||
if (!Warehouse.withdraw(cityWarehouse, npc, ibResources, amount, true)) {
|
||||
//ChatManager.chatGuildError(pc, "Failed to create Item");
|
||||
Logger.error("Warehouse With UID of " + cityWarehouse.UID + " Failed to Create Item." + ib.getName());
|
||||
return null;
|
||||
@@ -522,7 +522,7 @@ public class ItemFactory {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (overdraft > 0 && WarehouseManager.isResourceLocked(cityWarehouse, ItemBase.GOLD_ITEM_BASE)) {
|
||||
if (overdraft > 0 && Warehouse.isResourceLocked(cityWarehouse, ItemBase.GOLD_ITEM_BASE)) {
|
||||
|
||||
if (pc != null)
|
||||
ErrorPopupMsg.sendErrorMsg(pc, "Warehouse gold is barred! Overdraft cannot be withdrawn from warehouse." + ib.getName());
|
||||
@@ -552,7 +552,7 @@ public class ItemFactory {
|
||||
}
|
||||
|
||||
if (overdraft > 0)
|
||||
if (!WarehouseManager.withdraw(cityWarehouse, npc, ItemBase.GOLD_ITEM_BASE, overdraft, true)) {
|
||||
if (!Warehouse.withdraw(cityWarehouse, npc, ItemBase.GOLD_ITEM_BASE, overdraft, true)) {
|
||||
//ChatManager.chatGuildError(pc, "Failed to create Item");
|
||||
Logger.error("Warehouse With UID of " + cityWarehouse.UID + " Failed to Create Item." + ib.getName());
|
||||
return null;
|
||||
@@ -561,7 +561,7 @@ public class ItemFactory {
|
||||
// ChatManager.chatGuildInfo(pc, "Gold Cost = " + total);
|
||||
|
||||
if (galvorAmount > 0) {
|
||||
if (!WarehouseManager.withdraw(cityWarehouse, npc, galvor, galvorAmount, true)) {
|
||||
if (!Warehouse.withdraw(cityWarehouse, npc, galvor, galvorAmount, true)) {
|
||||
ErrorPopupMsg.sendErrorMsg(pc, "Failed to withdraw Galvor from warehouse!" + ib.getName());
|
||||
Logger.error("Warehouse with UID of" + cityWarehouse.getObjectUUID() + "Failed to Withdrawl ");
|
||||
return null;
|
||||
@@ -569,7 +569,7 @@ public class ItemFactory {
|
||||
}
|
||||
|
||||
if (wormwoodAmount > 0) {
|
||||
if (!WarehouseManager.withdraw(cityWarehouse, npc, wormwood, wormwoodAmount, true)) {
|
||||
if (!Warehouse.withdraw(cityWarehouse, npc, wormwood, wormwoodAmount, true)) {
|
||||
ErrorPopupMsg.sendErrorMsg(pc, "Failed to withdraw Wormwood from warehouse!" + ib.getName());
|
||||
Logger.error("Warehouse with UID of" + cityWarehouse.getObjectUUID() + "Failed to Withdrawl ");
|
||||
return null;
|
||||
@@ -852,7 +852,7 @@ public class ItemFactory {
|
||||
return null;
|
||||
|
||||
if (galvorAmount > 0) {
|
||||
if (WarehouseManager.isResourceLocked(cityWarehouse, galvor)) {
|
||||
if (Warehouse.isResourceLocked(cityWarehouse, galvor)) {
|
||||
ErrorPopupMsg.sendErrorMsg(pc, "Galvor is locked." + ib.getName());
|
||||
return null;
|
||||
}
|
||||
@@ -864,7 +864,7 @@ public class ItemFactory {
|
||||
}
|
||||
|
||||
if (wormwoodAmount > 0) {
|
||||
if (WarehouseManager.isResourceLocked(cityWarehouse, wormwood)) {
|
||||
if (Warehouse.isResourceLocked(cityWarehouse, wormwood)) {
|
||||
ErrorPopupMsg.sendErrorMsg(pc, "Galvor is locked." + ib.getName());
|
||||
return null;
|
||||
}
|
||||
@@ -908,7 +908,7 @@ public class ItemFactory {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (useWarehouse && overdraft > 0 && WarehouseManager.isResourceLocked(cityWarehouse, ItemBase.GOLD_ITEM_BASE)) {
|
||||
if (useWarehouse && overdraft > 0 && Warehouse.isResourceLocked(cityWarehouse, ItemBase.GOLD_ITEM_BASE)) {
|
||||
if (pc != null)
|
||||
ErrorPopupMsg.sendErrorMsg(pc, "Warehouse gold is barred! Overdraft cannot be withdrawn from warehouse." + ib.getName());
|
||||
return null;
|
||||
@@ -936,12 +936,12 @@ public class ItemFactory {
|
||||
// there was an overdraft, withdraw the rest from warehouse.
|
||||
if (overdraft > 0) {
|
||||
if (pc != null) {
|
||||
if (!WarehouseManager.withdraw(cityWarehouse, pc, ItemBase.GOLD_ITEM_BASE, overdraft, false, true)) {
|
||||
if (!Warehouse.withdraw(cityWarehouse, pc, ItemBase.GOLD_ITEM_BASE, overdraft, false, true)) {
|
||||
Logger.error("Warehouse with UID of" + cityWarehouse.getObjectUUID() + "Failed to Withdrawl ");
|
||||
return null;
|
||||
}
|
||||
} else {
|
||||
if (!WarehouseManager.withdraw(cityWarehouse, npc, ItemBase.GOLD_ITEM_BASE, overdraft, true)) {
|
||||
if (!Warehouse.withdraw(cityWarehouse, npc, ItemBase.GOLD_ITEM_BASE, overdraft, true)) {
|
||||
Logger.error("Warehouse with UID of" + cityWarehouse.getObjectUUID() + "Failed to Withdrawl ");
|
||||
return null;
|
||||
}
|
||||
@@ -959,7 +959,7 @@ public class ItemFactory {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (useWarehouse && overdraft > 0 && WarehouseManager.isResourceLocked(cityWarehouse, ItemBase.GOLD_ITEM_BASE)) {
|
||||
if (useWarehouse && overdraft > 0 && Warehouse.isResourceLocked(cityWarehouse, ItemBase.GOLD_ITEM_BASE)) {
|
||||
if (pc != null)
|
||||
ErrorPopupMsg.sendErrorMsg(pc, "Warehouse gold is barred! Overdraft cannot be withdrawn from warehouse." + ib.getName());
|
||||
return null;
|
||||
@@ -987,12 +987,12 @@ public class ItemFactory {
|
||||
if (overdraft > 0 && useWarehouse) {
|
||||
|
||||
if (pc != null) {
|
||||
if (!WarehouseManager.withdraw(cityWarehouse, pc, ItemBase.GOLD_ITEM_BASE, overdraft, false, true)) {
|
||||
if (!Warehouse.withdraw(cityWarehouse, pc, ItemBase.GOLD_ITEM_BASE, overdraft, false, true)) {
|
||||
Logger.error("Warehouse with UID of" + cityWarehouse.getObjectUUID() + "Failed to Withdrawl ");
|
||||
return null;
|
||||
}
|
||||
} else {
|
||||
if (!WarehouseManager.withdraw(cityWarehouse, npc, ItemBase.GOLD_ITEM_BASE, overdraft, true)) {
|
||||
if (!Warehouse.withdraw(cityWarehouse, npc, ItemBase.GOLD_ITEM_BASE, overdraft, true)) {
|
||||
Logger.error("Warehouse with UID of" + cityWarehouse.getObjectUUID() + "Failed to Withdrawl ");
|
||||
return null;
|
||||
}
|
||||
@@ -1002,7 +1002,7 @@ public class ItemFactory {
|
||||
|
||||
if (galvorAmount > 0 && useWarehouse) {
|
||||
//ChatManager.chatGuildInfo(pc, "Withdrawing " + galvorAmount + " galvor from warehouse");
|
||||
if (!WarehouseManager.withdraw(cityWarehouse, npc, galvor, galvorAmount, true)) {
|
||||
if (!Warehouse.withdraw(cityWarehouse, npc, galvor, galvorAmount, true)) {
|
||||
ErrorPopupMsg.sendErrorMsg(pc, "Failed to withdraw Galvor from warehouse!" + ib.getName());
|
||||
Logger.error("Warehouse with UID of" + cityWarehouse.getObjectUUID() + "Failed to Withdrawl ");
|
||||
return null;
|
||||
@@ -1011,7 +1011,7 @@ public class ItemFactory {
|
||||
|
||||
if (wormwoodAmount > 0 && useWarehouse) {
|
||||
//ChatManager.chatGuildInfo(pc, "Withdrawing " + wormwoodAmount + " wormwood from warehouse");
|
||||
if (!WarehouseManager.withdraw(cityWarehouse, npc, wormwood, wormwoodAmount, true)) {
|
||||
if (!Warehouse.withdraw(cityWarehouse, npc, wormwood, wormwoodAmount, true)) {
|
||||
ErrorPopupMsg.sendErrorMsg(pc, "Failed to withdraw Wormwood from warehouse for " + ib.getName());
|
||||
Logger.error("Warehouse with UID of" + cityWarehouse.getObjectUUID() + "Failed to Withdrawl ");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user