Browse Source

Test if the player has enough gold

remotes/origin/shop
Max Gerbeth 2 years ago
parent
commit
7f20018078
  1. 7
      src/main/java/org/bitbiome/shop/Shop.java

7
src/main/java/org/bitbiome/shop/Shop.java

@ -53,6 +53,13 @@ public class Shop {
return false;
}
//Test if the player has enough gold
int costs = currentShopItems.get(itemIndex).gold * amount;
int gold = (int) playerConfig.get("gold");
if(!(gold >= costs)){
System.out.println("Du hast zu wenig Gold!");
return false;
}
}catch (Exception e){
e.printStackTrace();

Loading…
Cancel
Save