Skip to content

Commit 06f287e

Browse files
committed
Add balance, remove unused method
1 parent a33b41a commit 06f287e

1 file changed

Lines changed: 2 additions & 11 deletions

File tree

‎src/main/java/net/earthmc/emcapi/endpoint/map/TownMapEndpoint.java‎

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
import com.google.gson.JsonArray;
44
import com.google.gson.JsonObject;
55
import com.palmergames.bukkit.towny.TownyAPI;
6+
import com.palmergames.bukkit.towny.TownyEconomyHandler;
67
import com.palmergames.bukkit.towny.object.Nation;
78
import com.palmergames.bukkit.towny.object.Resident;
89
import com.palmergames.bukkit.towny.object.Town;
910
import net.earthmc.emcapi.manager.TownMetadataManager;
1011
import net.earthmc.emcapi.util.HttpExceptions;
11-
import org.bukkit.Location;
1212

1313
import java.util.Collection;
1414

@@ -41,6 +41,7 @@ private JsonObject formatTown(Town town) {
4141
json.add("councillors", formatResidents(town.getRank("Councillor")));
4242
json.addProperty("founded", town.getRegistered());
4343
json.addProperty("claims", town.getNumTownBlocks());
44+
json.addProperty("balance", TownyEconomyHandler.isActive() ? town.getAccount().getCachedBalance() : 0);
4445
json.addProperty("pvp", town.isPVP());
4546
json.addProperty("public", town.isPublic());
4647

@@ -54,14 +55,4 @@ private JsonArray formatResidents(Collection<Resident> residents) {
5455
}
5556
return array;
5657
}
57-
58-
private JsonObject formatSpawn(Location spawn) {
59-
JsonObject json = new JsonObject();
60-
json.addProperty("world", spawn.getWorld().getName());
61-
json.addProperty("x", spawn.getBlockX());
62-
json.addProperty("y", spawn.getBlockY());
63-
json.addProperty("z", spawn.getBlockZ());
64-
65-
return json;
66-
}
6758
}

0 commit comments

Comments
 (0)