diff --git a/src/main/java/org/bitbiome/shop/Shop.java b/src/main/java/org/bitbiome/shop/Shop.java index dc00dca..5c4216c 100644 --- a/src/main/java/org/bitbiome/shop/Shop.java +++ b/src/main/java/org/bitbiome/shop/Shop.java @@ -66,8 +66,7 @@ public class Shop { } //Player gold subtract - gold -= costs; - playerConfig.put("gold", gold); + playerConfig.put("gold", subtractGold(gold, costs)); //Gameconfig amount reduese JSONArray jsonArray2 = gameConfig.getJSONArray("shopitems"); @@ -233,4 +232,8 @@ public class Shop { } System.out.println(""); } + + private int subtractGold(int gold, int cost){ + return gold - cost; + } }