feat: add global & server leveling, quests, achievements, guilds land-claiming, social & toggleable configs
This commit is contained in:
1 parent
4b79f69c20
commit
b4cef85b1f
40 files changed
+10261
-27
No files matched your search
@@ -42,4 +42,26 @@ public final class PanelClient {
|
||||
return message != null && message.isJsonPrimitive() && message.getAsJsonPrimitive().isString()
|
||||
? message.getAsString() : "You do not have access to this server.";
|
||||
}
|
||||
|
||||
public ChunkCheckResult checkChunk(String dimension, int chunkX, int chunkZ, java.util.UUID uuid) {
|
||||
if (!settings.guildsEnabled() || !settings.landClaimingEnabled()) {
|
||||
return new ChunkCheckResult(false, true, null, null);
|
||||
}
|
||||
JsonObject req = new JsonObject();
|
||||
req.addProperty("dimension", dimension);
|
||||
req.addProperty("chunk_x", chunkX);
|
||||
req.addProperty("chunk_z", chunkZ);
|
||||
req.addProperty("uuid", uuid.toString());
|
||||
try {
|
||||
JsonObject res = post("guilds/check-chunk", req);
|
||||
boolean claimed = res.has("claimed") && res.get("claimed").getAsBoolean();
|
||||
boolean allowed = !res.has("allowed") || res.get("allowed").getAsBoolean();
|
||||
String guildName = res.has("guild_name") && !res.get("guild_name").isJsonNull() ? res.get("guild_name").getAsString() : null;
|
||||
String guildTag = res.has("guild_tag") && !res.get("guild_tag").isJsonNull() ? res.get("guild_tag").getAsString() : null;
|
||||
return new ChunkCheckResult(claimed, allowed, guildName, guildTag);
|
||||
} catch (Exception e) {
|
||||
return new ChunkCheckResult(false, true, null, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user