Skip to content

Commit

Permalink
testmod: Update test command api to new client commands
Browse files Browse the repository at this point in the history
  • Loading branch information
jakobkmar committed Jun 23, 2022
1 parent a4558c5 commit 96f323c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions silk-testmod/src/main/kotlin/net/silkmc/silk/test/Manager.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ package net.silkmc.silk.test

import net.fabricmc.api.ClientModInitializer
import net.fabricmc.api.ModInitializer
import net.fabricmc.fabric.api.client.command.v2.FabricClientCommandSource
import net.minecraft.commands.CommandSourceStack
import net.silkmc.silk.commands.ClientCommandSourceStack
import net.silkmc.silk.commands.LiteralCommandBuilder
import net.silkmc.silk.commands.clientCommand
import net.silkmc.silk.commands.command
Expand All @@ -12,7 +12,7 @@ import net.silkmc.silk.test.network.NetworkTest

object Manager : ModInitializer, ClientModInitializer {
internal val testmodCommandBuilders = HashMap<String, LiteralCommandBuilder<CommandSourceStack>.() -> Unit>()
internal val clientTestmodCommandBuilders = HashMap<String, LiteralCommandBuilder<FabricClientCommandSource>.() -> Unit>()
internal val clientTestmodCommandBuilders = HashMap<String, LiteralCommandBuilder<ClientCommandSourceStack>.() -> Unit>()

override fun onInitialize() {
circleCommand
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package net.silkmc.silk.test.commands

import net.fabricmc.fabric.api.client.command.v2.FabricClientCommandSource
import net.minecraft.commands.CommandSourceStack
import net.silkmc.silk.commands.ClientCommandSourceStack
import net.silkmc.silk.commands.LiteralCommandBuilder
import net.silkmc.silk.test.Manager

Expand All @@ -14,7 +14,7 @@ fun testCommand(

fun clientTestCommand(
name: String,
builder: LiteralCommandBuilder<FabricClientCommandSource>.() -> Unit,
builder: LiteralCommandBuilder<ClientCommandSourceStack>.() -> Unit,
) {
Manager.clientTestmodCommandBuilders[name] = builder
}

0 comments on commit 96f323c

Please sign in to comment.