EarthMC/EMCAPI

Missing `canOutsidersSpawn` Flag in Town Status on API

Closed this issue · 2 comments

Missing canOutsidersSpawn Flag in Town Status on API

I have potentially identified an issue with the town status data returned by the EarthMC API. Specifically, the canOutsidersSpawn flag is not present in the town status object when querying the API.

Details:

According to the code snippet in the TownsEndpoint class, the canOutsidersSpawn flag should be part of the town status JSON object:

JsonObject statusObject = new JsonObject();
statusObject.addProperty("isPublic", town.isPublic());
statusObject.addProperty("isOpen", town.isOpen());
statusObject.addProperty("isNeutral", town.isNeutral());
statusObject.addProperty("isCapital", town.isCapital());
statusObject.addProperty("isOverClaimed", town.isOverClaimed());
statusObject.addProperty("isRuined", town.isRuined());
statusObject.addProperty("isForSale", town.isForSale());
statusObject.addProperty("hasNation", town.hasNation());
statusObject.addProperty("hasOverclaimShield", TownMetadataManager.hasOverclaimShield(town));
statusObject.addProperty("canOutsidersSpawn", TownMetadataManager.getCanOutsidersSpawn(town));

However, when querying a town with outsider spawning enabled (e.g., Brazil), the canOutsidersSpawn flag is missing in the response:

"status": {
  "isPublic": true,
  "isOpen": true,
  "isNeutral": false,
  "isCapital": false,
  "isOverClaimed": false,
  "isRuined": false,
  "isForSale": false,
  "hasNation": true,
  "hasOverclaimShield": false
}

Request:

Is this fault simply due to the fact the pull #10 is not live yet, and if so when will it be?
Or if the code is live, could there be an issue with the implementation that is preventing the canOutsidersSpawn flag from being included?

v3 is still technically early access in preparation for a post update with request bodies so its not stable, but due to me being busy with other stuff its taking a long time, that property was added but the update isn't live

I'll be looking forward for when this update goes live. Just having this canOutsidersSpawn flag would be incredibly useful for finding smaller towns to explore and buy stuff from.

the API is one of the things that makes EMC interesting, so thanks for all your work on it