Skip to content

Commit 4a4f18c

Browse files
authored
V4 revamp (#45)
* 1. General updates CooldownUtil, removal of legacy endpoints, cleaning up GetEndpoint#lookup overrides * 2. Update town & nation endpoints * 3. Add advancements endpoint * 4. Add Pursuits endpoint * 5. Add mcMMO endpoint
1 parent d2c9e0e commit 4a4f18c

44 files changed

Lines changed: 1068 additions & 400 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

build.gradle.kts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ repositories {
2828
maven("https://repo.codemc.io/repository/maven-public/") {
2929
mavenContent { includeGroup("com.ghostchu") }
3030
}
31+
32+
maven("https://nexus.neetgames.com/repository/maven-releases/") {
33+
mavenContent { includeGroup("com.gmail.nossr50.mcMMO") }
34+
}
3135
}
3236

3337
dependencies {
@@ -45,6 +49,13 @@ dependencies {
4549
implementation(libs.hikaricp) {
4650
exclude(group = "org.slf4j", module = "slf4j-api")
4751
}
52+
compileOnly(libs.mcmmo) {
53+
exclude("com.sk89q.worldguard")
54+
exclude("com.comphenix.protocol")
55+
}
56+
compileOnly(libs.lynchpin.pursuits)
57+
compileOnly(libs.lynchpin.towny)
58+
compileOnly(libs.lynchpin.advancements)
4859
}
4960

5061
tasks {

docs/advancements.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Advancements Endpoint
2+
Accessed at https://api.earthmc.net/v4/advancements
3+
4+
The advancements endpoint provides information about the first time an advancement was completed. The information here is live.
5+
6+
Example **GET** response
7+
```json5
8+
{
9+
"minecraft:story/mine_diamond": { // Advancement name
10+
"player": "e25ad129-fe8a-4306-b1af-1dee1ff59841", // UUID of the player who completed it first
11+
"date": "2026-05-10" // The date it was completed
12+
},
13+
"minecraft:adventure/revaulting": {
14+
"player": "e25ad129-fe8a-4306-b1af-1dee1ff59841",
15+
"date": "2026-05-10"
16+
},
17+
"minecraft:adventure/root": {
18+
"player": "0bacd488-bc41-4f76-ba8b-50dc843efe49",
19+
"date": "2026-04-29"
20+
},
21+
"minecraft:adventure/under_lock_and_key": {
22+
"player": "e25ad129-fe8a-4306-b1af-1dee1ff59841",
23+
"date": "2026-05-10"
24+
},
25+
"minecraft:adventure/trade_at_world_height": {
26+
"player": "5b8274bf-b162-4336-85a0-48f9d5380a78",
27+
"date": "2026-04-12"
28+
},
29+
"minecraft:story/smelt_iron": {
30+
"player": "e25ad129-fe8a-4306-b1af-1dee1ff59841",
31+
"date": "2026-05-10"
32+
},
33+
"minecraft:adventure/sleep_in_bed": {
34+
"player": "5b8274bf-b162-4336-85a0-48f9d5380a78",
35+
"date": "2026-04-12"
36+
},
37+
"minecraft:adventure/fall_from_world_height": {
38+
"player": "5b8274bf-b162-4336-85a0-48f9d5380a78",
39+
"date": "2026-04-07"
40+
}
41+
}
42+
```

docs/discord.md

Lines changed: 0 additions & 40 deletions
This file was deleted.

docs/keys.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,5 @@ You may at anytime copy your existing API key with `/api key copy`
66

77
Keys currently serve 2 purposes:
88
1. Allowing access to the server's SSE endpoint (`/events`)
9-
2. Allowing players to query their own data - Players can query their own resident information even if they have opted out, and they may view information about their shops in the `/shop` endpoint.
9+
2. Allowing players to query their own data - Players can query their own resident information even if they have opted out, and they may view additional information about themselves. Example endpoints: `/shop`, `/mcmmo`.
10+
3. Allowing players to query 'private' endpoints which have a stricter rate limit. Example endpoints: `/pursuits`, `/mcmmo-top`

docs/mcmmo.md

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
# mcMMO Endpoints
2+
## Personal endpoint
3+
Accessed at https://api.earthmc.net/v4/mcmmo
4+
5+
The mcMMO endpoint provides information about a player's mcMMO levels.
6+
It is important to note that the information here is not public, and players can only access their own information, using their API key.
7+
8+
The rate limit for this endpoint is one request per hour per API key (and thus per player).
9+
10+
Example **POST** request
11+
```json5
12+
{
13+
"query": ["PLAYER_UUID"],
14+
"key": "API_KEY"
15+
}
16+
```
17+
The player UUID must match the API key's owner.
18+
19+
Example **POST** response
20+
```json5
21+
[
22+
{
23+
"name": "Veyronity",
24+
"ACROBATICS": 21,
25+
"ALCHEMY": 0,
26+
"ARCHERY": 0,
27+
"AXES": 0,
28+
"CROSSBOWS": 0,
29+
"EXCAVATION": 0,
30+
"FISHING": 0,
31+
"HERBALISM": 0,
32+
"MACES": 0,
33+
"MINING": 1,
34+
"REPAIR": 0,
35+
"SALVAGE": 0,
36+
"SMELTING": 0,
37+
"SPEARS": 0,
38+
"SWORDS": 0,
39+
"TAMING": 0,
40+
"TRIDENTS": 0,
41+
"UNARMED": 0,
42+
"WOODCUTTING": 50
43+
}
44+
]
45+
```
46+
The player's name and their level in each primary skill. The overall power level can be calculated by adding all the values.
47+
48+
## Top endpoint
49+
Accessed at https://api.earthmc.net/v4/mcmmo-top
50+
51+
The mcMMO-top endpoint provides the leaderboard of a specified skill.
52+
53+
The rate limit for this endpoint is one request per 2 minutes per API key.
54+
55+
Example **POST** request
56+
```json5
57+
{
58+
"query": ["SKILL"], // Skill name (E.g. 'FISHING', 'MINING'), or 'POWER' for the overall power leaderboard
59+
"key": "API_KEY"
60+
}
61+
```
62+
63+
Example **POST** response
64+
```json5
65+
[
66+
{
67+
"skill": "power",
68+
"1": {
69+
"player": "K1kimor",
70+
"level": 12078
71+
},
72+
"2": {
73+
"player": "Veyronity",
74+
"level": 72
75+
},
76+
"3": {
77+
"player": "Andre1098",
78+
"level": 29
79+
},
80+
"lastUpdated": 1779619278
81+
}
82+
]
83+
```
84+
The information is not live, it is cached & updated every 15 minutes. The field `lastUpdated` provides the epoch second that the information was last updated at.

docs/nations.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ Example **POST** response
5050
"dynmapColour": "FFA500", // Nation's hex Dynmap colour
5151
"dynmapOutline": "FFFF00", // Nation's hex Dynmap outline
5252
"wiki": null, // The nation's wiki URL as a string if set, returns null if not
53+
"discord": null, // The nation's discord URL
5354
"king": {
5455
"name": "tuzzzie",
5556
"uuid": "8391474f-4b57-412a-a835-96bd2c253219"
@@ -185,6 +186,30 @@ Example **POST** response
185186
],
186187
"Colonist": [],
187188
"Diplomat": []
189+
},
190+
"embargoes": {
191+
"own": [ // A JSON array representing all nations that this nation has placed an embargo on
192+
{
193+
"name": "woodland",
194+
"uuid": "625a3d73-b179-4335-a512-58366c90dcfe"
195+
}
196+
],
197+
"against": [] // A JSON array representing all nations that have placed an embargo on this nation
198+
},
199+
"pacts": { // Container for 'active' and 'pending' JSON dictionaries for pacts this nation is involved in, where the key is the name of the other nation in the pact, and the value is a detailed pact object
200+
"active": { // A JSON dictionary representing active pacts this nation has
201+
"LizardLand": {
202+
"sender": "dev",
203+
"receiver": "LizardLand",
204+
"status": "ACTIVE",
205+
"stats": {
206+
"createdAt": 1779459092037,
207+
"expiresAt": 1779545525988,
208+
"duration": 1
209+
}
210+
}
211+
},
212+
"pending": {} // A JSON dictionary representing pending pacts this nation has.
188213
}
189214
}
190215
]

docs/pursuits.md

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# Pursuit Endpoint
2+
Accessed at https://api.earthmc.net/v4/pursuits
3+
4+
The pursuits endpoint provides information about pursuits' leaderboards.
5+
Only the top 10 entries are included.
6+
7+
The rate limit for this endpoint is one request per minute per API key.
8+
9+
Example **POST** request
10+
```json5
11+
{
12+
"query": ["TYPE"], // The pursuit type (PLAYER, TOWN, or NATION) - 'ALL' for all
13+
"key": "API_KEY"
14+
}
15+
```
16+
17+
Example **POST** response
18+
```json5
19+
[
20+
{
21+
"PLAYER": {
22+
"name": "mcmmo-smelting",
23+
"isActive": true,
24+
"top": {
25+
"1": {
26+
"player": "686b1bfa-38de-4eb9-9628-43ed3b56b76e",
27+
"score": 50.0
28+
},
29+
"2": {
30+
"player": "5b8274bf-b162-4336-85a0-48f9d5380a78",
31+
"score": 25.0
32+
},
33+
"3": {
34+
"player": "be66697b-bde8-4d70-b339-4ba15b390fa9",
35+
"score": 10.0
36+
}
37+
}
38+
},
39+
"NATION": {
40+
"name": "votes",
41+
"isActive": true,
42+
"top": {}
43+
},
44+
"TOWN": {
45+
"name": "votes",
46+
"isActive": true,
47+
"top": {
48+
"1": {
49+
"town": "f6bc3242-77a6-4020-ad1c-7df4a4c0e436",
50+
"score": 35.0
51+
},
52+
"2": {
53+
"town": "fa14cbc6-3215-481c-b427-a411b519178f",
54+
"score": 12.0
55+
}
56+
}
57+
}
58+
}
59+
]
60+
```

docs/shop.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ Accessed at https://api.earthmc.net/v4/shop
44
The shop endpoint provides information about player-owned QuickShops.
55
It is important to note that the information here is not public, and players can only access their own shops' information, using their API key.
66

7+
The rate limit for this endpoint is one request per hour per API key (and thus per player).
8+
79
Each shop object has the following properties:
810
- `id` - The unique identifier of the shop
911
- `item` - The Material/name of the item being traded

docs/towns.md

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ Example **POST** response
4949
"board": "Fishing every Friday! Join our Discord, link can be found on the signs!", // Town's board as seen on /t, null if none is present
5050
"founder": "tuzzzie", // The founder of the town as seen on /t
5151
"wiki": null, // The town's wiki URL as a string if set, returns null if not
52+
"discord": null, // The town's wiki URL
5253
"mayor": {
5354
"name": "Fruitloopins",
5455
"uuid": "fed0ec4a-f1ad-4b97-9443-876391668b34"
@@ -71,8 +72,10 @@ Example **POST** response
7172
"isRuined": false, // True if the town is ruined
7273
"isForSale": false, // True if the town is for sale
7374
"hasNation": true, // True if the town has a nation
74-
"hasOverclaimShield": false, // True if the town currently has an overclaim shield
7575
"canOutsidersSpawn": false, // True if the town allows outsiders to teleport
76+
"canPassiveMobsSpawn": true, // True if the town has passive mob spawn enabled
77+
"hasSnowAccumulation": true, // True if the town has snow accumulation enabled
78+
"hasFriendlyFire": false, // True if the town has friendly-fire enabled
7679
},
7780
"stats": {
7881
"numTownBlocks": 473, // The total number of town blocks the town has
@@ -270,7 +273,22 @@ Example **POST** response
270273
"Treasurer": [],
271274
"Realtor": [],
272275
"Settler": []
273-
}
276+
},
277+
"warps": [
278+
{
279+
"name": "cool_warp",
280+
"uuid": "936fe2be-1461-4a77-828f-a9aa073f827e",
281+
"createdAt": 1779458705887,
282+
"createdBy": "Veyronity",
283+
"access": "RESIDENT",
284+
"location": {
285+
"x": 1,
286+
"y": 185,
287+
"z": -9
288+
}
289+
}
290+
]
291+
}
274292
}
275293
]
276294
```

gradle/libs.versions.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ mysterymaster-api = "1.0.0"
88
superbvote = "0.6.0"
99
quickshop = "6.2.0.11"
1010
hikaricp = "7.0.2"
11+
mcmmo = "2.2.040"
12+
lynchpin-api = "1.0-SNAPSHOT"
1113

1214
# plugins
1315
conventions = "1.0.8"
@@ -24,6 +26,10 @@ superbvote = { group = "net.earthmc.superbvote", name = "SuperbVote", version.re
2426
quickshop = { group = "com.ghostchu", name = "quickshop-bukkit", version.ref = "quickshop" }
2527
quickshop-api = { group = "com.ghostchu", name = "quickshop-api", version.ref = "quickshop" }
2628
hikaricp = { group = "com.zaxxer", name = "HikariCP", version.ref = "hikaricp" }
29+
mcmmo = { group = "com.gmail.nossr50.mcMMO", name = "mcMMO", version.ref = "mcmmo" }
30+
lynchpin-pursuits = { group = "net.earthmc.lynchpin.api", name = "pursuits", version.ref = "lynchpin-api"}
31+
lynchpin-towny = { group = "net.earthmc.lynchpin.api", name = "towny", version.ref = "lynchpin-api"}
32+
lynchpin-advancements = { group = "net.earthmc.lynchpin.api", name = "advancements", version.ref = "lynchpin-api"}
2733

2834
[plugins]
2935
conventions-java = { id = "net.earthmc.conventions.java", version.ref = "conventions" }

0 commit comments

Comments
 (0)