diff options
Diffstat (limited to 'src/main/kotlin/io/github/moulberry/notenoughupdates/commands/dev/DevTestCommand.kt')
| -rw-r--r-- | src/main/kotlin/io/github/moulberry/notenoughupdates/commands/dev/DevTestCommand.kt | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/src/main/kotlin/io/github/moulberry/notenoughupdates/commands/dev/DevTestCommand.kt b/src/main/kotlin/io/github/moulberry/notenoughupdates/commands/dev/DevTestCommand.kt index 3292a9cf..e72a1ed4 100644 --- a/src/main/kotlin/io/github/moulberry/notenoughupdates/commands/dev/DevTestCommand.kt +++ b/src/main/kotlin/io/github/moulberry/notenoughupdates/commands/dev/DevTestCommand.kt @@ -36,6 +36,7 @@ import io.github.moulberry.notenoughupdates.util.brigadier.* import net.minecraft.client.Minecraft import net.minecraft.client.gui.GuiScreen import net.minecraft.command.ICommandSender +import net.minecraft.entity.item.EntityArmorStand import net.minecraft.entity.player.EntityPlayer import net.minecraft.launchwrapper.Launch import net.minecraft.util.ChatComponentText @@ -45,7 +46,6 @@ import net.minecraftforge.common.MinecraftForge import net.minecraftforge.fml.common.eventhandler.SubscribeEvent import java.util.function.Predicate import kotlin.math.floor -import kotlin.math.nextDown @NEUAutoSubscribe class DevTestCommand { @@ -106,6 +106,23 @@ class DevTestCommand { requires { canPlayerExecute(it) } + thenLiteral("joinServer") { + thenArgument("serverId", RestArgumentType) { serverId -> + thenExecute { + try { + MC.sessionService.joinServer( + MC.session.profile, + MC.session.token, + get(serverId) + ) + reply("Joined server ${get(serverId)}") + } catch (e: Exception) { + e.printStackTrace() + reply("Failed to join server") + } + } + }.withHelp("Send a joinServer request to mojang (to test authentication with the cape server)") + } thenLiteral("testsearch") { thenArgument("name", RestArgumentType) { arg -> thenExecute { |
