From 4972cd405dc19a1e1f37961050645172b8765070 Mon Sep 17 00:00:00 2001 From: Rafa <32463720+Rafacasari@users.noreply.github.com> Date: Mon, 10 Jun 2024 08:50:05 -0300 Subject: [PATCH] Now works with Fabric, magic! --- .../client/commands/OpenCobbledexCommand.kt | 12 ++++++++---- gradle.properties | 2 +- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/common/src/main/kotlin/com/rafacasari/mod/cobbledex/client/commands/OpenCobbledexCommand.kt b/common/src/main/kotlin/com/rafacasari/mod/cobbledex/client/commands/OpenCobbledexCommand.kt index 584c34c..1aafe47 100644 --- a/common/src/main/kotlin/com/rafacasari/mod/cobbledex/client/commands/OpenCobbledexCommand.kt +++ b/common/src/main/kotlin/com/rafacasari/mod/cobbledex/client/commands/OpenCobbledexCommand.kt @@ -8,6 +8,7 @@ import com.mojang.brigadier.CommandDispatcher import com.mojang.brigadier.context.CommandContext import com.mojang.brigadier.exceptions.SimpleCommandExceptionType import com.rafacasari.mod.cobbledex.client.gui.CobbledexGUI +import net.minecraft.client.MinecraftClient import net.minecraft.command.CommandSource object OpenCobbledexCommand : IClientCommandInterface { @@ -36,15 +37,18 @@ object OpenCobbledexCommand : IClientCommandInterface { throw NO_POKEMON_EXCEPTION.create() } - CobbledexGUI.openCobbledexScreen(properties.create()) + MinecraftClient.getInstance().send { + CobbledexGUI.openCobbledexScreen(properties.create()) + } + return Command.SINGLE_SUCCESS } private fun execute(): Int { - - CobbledexGUI.openCobbledexScreen() - + MinecraftClient.getInstance().send { + CobbledexGUI.openCobbledexScreen() + } return Command.SINGLE_SUCCESS } diff --git a/gradle.properties b/gradle.properties index 0f5608e..8c601d7 100644 --- a/gradle.properties +++ b/gradle.properties @@ -8,7 +8,7 @@ mod_id=cobbledex generated_file_name_addon=-1.20.1 archives_base_name=cobbledex-1.20.1 -mod_version=1.0.8 +mod_version=1.0.9 mod_description=A mod to track your progress on Cobblemon. Fabric and Forge compatible. mod_icon=assets/cobbledex/icon.png repository=https://github.com/rafacasari/cobbledex