diff --git a/minecraft/src/main/java/org/polyfrost/oneconfig/internal/OneConfig.java b/minecraft/src/main/java/org/polyfrost/oneconfig/internal/OneConfig.java index 1bee8f8fe..c1e2e33aa 100644 --- a/minecraft/src/main/java/org/polyfrost/oneconfig/internal/OneConfig.java +++ b/minecraft/src/main/java/org/polyfrost/oneconfig/internal/OneConfig.java @@ -107,10 +107,6 @@ private static void registerCommands() { CommandManager.INSTANCE.register(CommandManager.literal("ocfg").executes(executor).redirect(node)); } - public static boolean isInChatScreen() { - return Platform.screen().current() instanceof ChatScreen; - } - private static void registerKeybinds() { // Supply the open-GUI action to the config-backed OneConfig keybind. The action lives here (not on the // keybind itself) because it references platform classes and is lost when the keybind is deserialized. diff --git a/minecraft/src/main/kotlin/org/polyfrost/oneconfig/utils/v1/dsl/screens.kt b/minecraft/src/main/kotlin/org/polyfrost/oneconfig/utils/v1/dsl/screens.kt index 18715caf1..636a60b78 100644 --- a/minecraft/src/main/kotlin/org/polyfrost/oneconfig/utils/v1/dsl/screens.kt +++ b/minecraft/src/main/kotlin/org/polyfrost/oneconfig/utils/v1/dsl/screens.kt @@ -27,14 +27,12 @@ package org.polyfrost.oneconfig.utils.v1.dsl import com.mojang.brigadier.builder.LiteralArgumentBuilder -import net.minecraft.client.Minecraft import net.minecraft.client.gui.screens.Screen import org.polyfrost.oneconfig.api.commands.v1.ClientCommandSource import org.polyfrost.oneconfig.api.commands.v1.CommandManager import org.polyfrost.oneconfig.api.config.v1.Config import org.polyfrost.oneconfig.api.config.v1.Tree import org.polyfrost.oneconfig.api.platform.v1.Platform -import org.polyfrost.oneconfig.internal.OneConfig import org.polyfrost.oneconfig.internal.ui.api.ConfigRegistry import org.polyfrost.oneconfig.internal.ui.api.ConfigSource import org.polyfrost.oneconfig.internal.ui.compose.impls.OneConfigUIScreen @@ -84,13 +82,8 @@ fun Config.openUI() = Platform.screen().display(createScreen()) fun Config.openUI(initialCategory: String) = Platform.screen().display(createScreen(initialCategory)) fun Config.addDefaultCommand(command: String = this.title.lowercase()): LiteralArgumentBuilder { - return CommandManager.literal(command).executes { ctx -> - //? if >= 26.2 { - /*Minecraft.getInstance().gui.setScreen(this.createScreen()) - *///?} else { - Minecraft.getInstance().screen?.onClose() - Minecraft.getInstance().screen = this.createScreen() - //?} + return CommandManager.literal(command).executes { + openUI() 1 } } diff --git a/modules/compat/api/compat.api b/modules/compat/api/compat.api deleted file mode 100644 index e69de29bb..000000000 diff --git a/modules/compat/src/main/kotlin/org/polyfrost/oneconfig/compat/ClientCommandSource.kt b/modules/compat/src/main/kotlin/org/polyfrost/oneconfig/compat/ClientCommandSource.kt deleted file mode 100644 index 4820fac32..000000000 --- a/modules/compat/src/main/kotlin/org/polyfrost/oneconfig/compat/ClientCommandSource.kt +++ /dev/null @@ -1,9 +0,0 @@ -package org.polyfrost.oneconfig.compat - -import net.kyori.adventure.text.Component - -interface ClientCommandSource { - - fun sendMessage(text: Component) - -} \ No newline at end of file diff --git a/modules/compat/src/main/kotlin/org/polyfrost/oneconfig/compat/ModInfo.kt b/modules/compat/src/main/kotlin/org/polyfrost/oneconfig/compat/ModInfo.kt deleted file mode 100644 index 2dce666ea..000000000 --- a/modules/compat/src/main/kotlin/org/polyfrost/oneconfig/compat/ModInfo.kt +++ /dev/null @@ -1,17 +0,0 @@ -package org.polyfrost.oneconfig.compat - -import java.nio.file.Path - -data class ModInfo( - val id: String, - val name: String, - val version: String, - val file: Path?, - val authors: String? = null, - val credits: String? = null, -){ - companion object { - @get:JvmStatic - val loadedMods: Set get() = Pl.listMods() - } -} diff --git a/modules/compat/src/main/kotlin/org/polyfrost/oneconfig/compat/OneConfigVersionUtils.kt b/modules/compat/src/main/kotlin/org/polyfrost/oneconfig/compat/OneConfigVersionUtils.kt deleted file mode 100644 index 1fde126a0..000000000 --- a/modules/compat/src/main/kotlin/org/polyfrost/oneconfig/compat/OneConfigVersionUtils.kt +++ /dev/null @@ -1,15 +0,0 @@ -package org.polyfrost.oneconfig.compat - -import net.kyori.adventure.text.Component - -interface VersionUtils { -} -private lateinit var utils: VersionUtils - -object OneConfigVersionUtils : VersionUtils by utils { - init { - utils = Class.forName("org.polyfrost.oneconfig.compat.OneConfigVersionUtilsImpl") - .getField("INSTANCE") - .get(null) as VersionUtils - } -} \ No newline at end of file