From e79fd0c3b4a712b5f6e5e8e1cf367a45f6e0029f Mon Sep 17 00:00:00 2001 From: MagicBot Date: Sun, 12 May 2024 11:46:28 -0400 Subject: [PATCH] Unused method removed --- src/engine/objects/Warehouse.java | 28 ---------------------------- 1 file changed, 28 deletions(-) diff --git a/src/engine/objects/Warehouse.java b/src/engine/objects/Warehouse.java index fde2ca1d..7bf3061c 100644 --- a/src/engine/objects/Warehouse.java +++ b/src/engine/objects/Warehouse.java @@ -371,34 +371,6 @@ public class Warehouse { } - public static synchronized boolean withdraw(Warehouse warehouse, NPC npc, mbEnums.ResourceType resourceType, int amount, boolean transaction) { - - int oldAmount = warehouse.resources.get(resourceType); - - int newAmount = oldAmount - amount; - - if (warehouse.resources.get(resourceType) == null) - return false; - - if (amount <= 0) - return false; - - if (oldAmount < amount) - return false; - - warehouse.resources.put(resourceType, newAmount); - - if (!DbManager.WarehouseQueries.UPDATE_WAREHOUSE(warehouse)) { - warehouse.resources.put(resourceType, oldAmount); - return false; - } - - if (transaction) - AddTransactionToWarehouse(warehouse, npc.getObjectType(), npc.getObjectUUID(), mbEnums.TransactionType.WITHDRAWL, resourceType, amount); - - return true; - } - public static synchronized void transferResources(Warehouse warehouse, PlayerCharacter taxer, TaxResourcesMsg msg, ArrayList realmResources, float taxPercent) { for (mbEnums.ResourceType resourceType : realmResources) {