Browse Source

refactoring: changed float to int

remotes/origin/map
Tanja Herche 2 years ago
parent
commit
7dc1ba1b76
  1. 2
      src/main/java/org/bitbiome/commands/GoldCommand.java
  2. 6
      src/main/java/org/bitbiome/entities/Player.java

2
src/main/java/org/bitbiome/commands/GoldCommand.java

@ -12,7 +12,7 @@ public class GoldCommand implements CommandAPI{
public static String getGoldMessage(Player player) { public static String getGoldMessage(Player player) {
return "Dein Gold: " + player.getGold();
return "Du hast " + player.getGold() + " Gold";
} }
@Override @Override

6
src/main/java/org/bitbiome/entities/Player.java

@ -24,7 +24,7 @@ public class Player {
hp = 100.0F; hp = 100.0F;
location = new Location(jp.getJSONObject("playerconfig.json").getString("currentLocation"), new ArrayList<>(), new ArrayList<>()); location = new Location(jp.getJSONObject("playerconfig.json").getString("currentLocation"), new ArrayList<>(), new ArrayList<>());
inventory = new ArrayList<>(); inventory = new ArrayList<>();
gold = jp.getJSONObject("playerconfig.json").getFloat("gold");
gold = jp.getJSONObject("playerconfig.json").getInt("gold");
} }
public String getName() { public String getName() {
@ -63,8 +63,8 @@ public class Player {
this.name = name; this.name = name;
} }
public float getGold() { return gold; }
public int getGold() { return (int) gold; }
public void setGold(float gold) { this.gold = gold; }
public int setGold(int gold) { this.gold = gold; return gold; }
} }
Loading…
Cancel
Save