Skip to content

Commit 554e2c3

Browse files
committed
ok
1 parent 49d78a7 commit 554e2c3

4 files changed

Lines changed: 16 additions & 10 deletions

File tree

src/main/kotlin/net/chariskar/breakthemod/Breakthemod.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import net.chariskar.breakthemod.client.api.Command
2020
import net.chariskar.breakthemod.client.api.engine.NearbyEngine
2121
import net.chariskar.breakthemod.client.commands.Debug
2222
import net.chariskar.breakthemod.client.commands.discordId
23-
import net.chariskar.breakthemod.client.commands.findPlayer
23+
import net.chariskar.breakthemod.client.commands.FindPlayer
2424
import net.chariskar.breakthemod.client.commands.goto
2525
import net.chariskar.breakthemod.client.commands.help
2626
import net.chariskar.breakthemod.client.commands.lastSeen
@@ -59,7 +59,7 @@ class Breakthemod : ClientModInitializer {
5959
onlineStaff(),
6060
townless(),
6161
goto(),
62-
findPlayer(),
62+
FindPlayer(),
6363
lastSeen(),
6464
discordId(),
6565
locate(),

src/main/kotlin/net/chariskar/breakthemod/client/commands/findPlayer.kt renamed to src/main/kotlin/net/chariskar/breakthemod/client/commands/FindPlayer.kt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import net.fabricmc.fabric.api.client.command.v2.FabricClientCommandSource
1919
import net.minecraft.text.Text
2020
import net.minecraft.util.Formatting
2121

22-
class findPlayer : Command() {
22+
class FindPlayer : Command() {
2323
init {
2424
name = "findPlayer"
2525
description = "Tells you where a player is based on the map api."
@@ -45,6 +45,8 @@ class findPlayer : Command() {
4545
val players: MutableList<MapResponse>? = null
4646
)
4747

48+
49+
4850
override fun execute(ctx: CommandContext<FabricClientCommandSource>): Int {
4951
val name: String = ctx.getArgument("name", String::class.java)
5052
scope.launch {
@@ -80,6 +82,7 @@ class findPlayer : Command() {
8082
}
8183
return 0
8284
}
85+
8386
override fun register(dispatcher: CommandDispatcher<FabricClientCommandSource>) {
8487
dispatcher.register(
8588
LiteralArgumentBuilder.literal<FabricClientCommandSource>(name)

src/main/kotlin/net/chariskar/breakthemod/client/objects/Nation.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@ class Nation(val name: String) {
7979

8080
@Serializable
8181
data class Ranks(
82-
var Chancellor: List<Resident>? = null,
83-
var Colonist: List<Resident>? = null,
84-
var Diplomat: List<Resident>? = null
82+
var Chancellor: List<Reference>? = null,
83+
var Colonist: List<Reference>? = null,
84+
var Diplomat: List<Reference>? = null
8585
)
8686
}

src/test/kotlin/net/chariskar/breakthemod/apiTest/EarthmcApiTest.kt

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
package net.chariskar.breakthemod.apiTest;
22

3+
import kotlinx.coroutines.launch
34
import kotlinx.coroutines.runBlocking
45
import net.chariskar.breakthemod.Main
6+
import net.chariskar.breakthemod.TestScope
57
import net.chariskar.breakthemod.client.api.Fetch
68
import net.chariskar.breakthemod.client.objects.Nation
79
import net.chariskar.breakthemod.client.objects.Resident
@@ -15,10 +17,11 @@ import kotlin.test.assertIs
1517
* Test class for [net.chariskar.breakthemod.client.api.Fetch]
1618
* */
1719
class EarthmcApiTest {
20+
val scope = TestScope.scope
1821

1922
@Test
2023
fun `test GET request`() {
21-
runBlocking {
24+
scope.launch {
2225
val result = Fetch.getRequest<StaffList>(Main.config.staffRepoUrl)
2326
assertNotNull(result)
2427
assertIs<StaffList>(result)
@@ -27,7 +30,7 @@ class EarthmcApiTest {
2730

2831
@Test
2932
fun `test towns`() {
30-
runBlocking {
33+
scope.launch {
3134
val result = Fetch.getTown("paris")
3235
assertNotNull(result)
3336
assertIs<Town>(result)
@@ -36,7 +39,7 @@ class EarthmcApiTest {
3639

3740
@Test
3841
fun `test nations`() {
39-
runBlocking {
42+
scope.launch {
4043
val result = Fetch.getNation("france")
4144
assertNotNull(result)
4245
assertIs<Nation>(result)
@@ -45,7 +48,7 @@ class EarthmcApiTest {
4548

4649
@Test
4750
fun `test players`() {
48-
runBlocking {
51+
scope.launch {
4952
val result = Fetch.getResident("charis_k")
5053
assertNotNull(result)
5154
assertIs<Resident>(result)

0 commit comments

Comments
 (0)