diff --git a/build.gradle.kts b/build.gradle.kts index 9f4f349..0238193 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -23,7 +23,6 @@ repositories { maven("https://jitpack.io") maven("https://maven.meteordev.org/releases") maven("https://pkgs.dev.azure.com/djtheredstoner/DevAuth/_packaging/public/maven/v1") - maven("https://api.modrinth.com/maven") maven("https://mvn.oblongboot.dev/") } @@ -34,9 +33,12 @@ dependencies { modImplementation("net.fabricmc:fabric-language-kotlin:${property("fabric_kotlin_version")}") modImplementation("net.fabricmc.fabric-api:fabric-api:${property("fabric_version")}") + modImplementation("org.cobalt:cobalt:0.0.1") modRuntimeOnly("me.djtheredstoner:DevAuth-fabric:1.2.1") + implementation("meteordevelopment:discord-ipc:1.1") + implementation("org.reflections:reflections:0.10.2") modImplementation("org.lwjgl:lwjgl-nanovg:${lwjglVersion}") listOf("windows", "linux", "macos", "macos-arm64").forEach { diff --git a/gradle.properties b/gradle.properties index 679e564..b1d63b8 100644 --- a/gradle.properties +++ b/gradle.properties @@ -11,8 +11,8 @@ lwjglVersion=3.3.3 minecraft_version=1.21.10 yarn_mappings=1.21.10+build.2 loader_version=0.17.3 -loom_version=1.11-SNAPSHOT +loom_version=1.13-SNAPSHOT # Dependency Versions -fabric_version=0.136.0+1.21.10 -fabric_kotlin_version=1.13.6+kotlin.2.2.20 +fabric_version=0.138.3+1.21.10 +fabric_kotlin_version=1.13.7+kotlin.2.2.21 diff --git a/lib/Cobalt-1.0.0.jar b/lib/Cobalt-1.0.0.jar deleted file mode 100644 index 0257b0c..0000000 Binary files a/lib/Cobalt-1.0.0.jar and /dev/null differ diff --git a/src/main/kotlin/com/example/ExampleAddon.kt b/src/main/kotlin/com/example/ExampleAddon.kt index 391d723..0b9b025 100644 --- a/src/main/kotlin/com/example/ExampleAddon.kt +++ b/src/main/kotlin/com/example/ExampleAddon.kt @@ -4,27 +4,19 @@ import com.example.command.ExampleCommand import com.example.module.ExampleModule import org.cobalt.api.addon.Addon import org.cobalt.api.command.CommandManager -import org.cobalt.api.module.Category -import org.cobalt.api.event.EventBus import org.cobalt.api.module.ModuleManager object ExampleAddon : Addon() { - val CATEGORY = Category("Example", "/assets/exampleaddon/icon.svg") - - override fun onInitialize() { + override fun onLoad() { ModuleManager.addModules(ExampleModule) CommandManager.register(ExampleCommand) - println("ExampleAddon initialized!") + println("ExampleAddon loaded!") } override fun onUnload() { - ModuleManager.removeModule(ExampleModule) - CommandManager.removeCommand(ExampleCommand) - EventBus.unregister(this) - println("ExampelAddon unloaded!") + println("ExampleAddon unloaded!") } - } diff --git a/src/main/kotlin/com/example/command/ExampleCommand.kt b/src/main/kotlin/com/example/command/ExampleCommand.kt index 2bd31ed..42bd8dc 100644 --- a/src/main/kotlin/com/example/command/ExampleCommand.kt +++ b/src/main/kotlin/com/example/command/ExampleCommand.kt @@ -3,6 +3,7 @@ package com.example.command import org.cobalt.api.command.Command import org.cobalt.api.command.annotation.DefaultHandler import org.cobalt.api.command.annotation.SubCommand +import org.cobalt.api.util.ChatUtils object ExampleCommand : Command( name = "example", @@ -16,7 +17,7 @@ object ExampleCommand : Command( @SubCommand fun hello(name: String) { - println("Hello, $name!") + ChatUtils.sendMessage("Hello, $name!") } } diff --git a/src/main/kotlin/com/example/module/ExampleModule.kt b/src/main/kotlin/com/example/module/ExampleModule.kt index ed14d82..a233af1 100644 --- a/src/main/kotlin/com/example/module/ExampleModule.kt +++ b/src/main/kotlin/com/example/module/ExampleModule.kt @@ -1,6 +1,5 @@ package com.example.module -import com.example.ExampleAddon import java.awt.Color import org.cobalt.api.module.Module import org.cobalt.api.module.setting.impl.* @@ -8,16 +7,62 @@ import org.lwjgl.glfw.GLFW object ExampleModule : Module( name = "Example Module", - category = ExampleAddon.CATEGORY + category = "Example" ) { - val checkbox by CheckboxSetting("Checkbox", "Example checkbox setting", true) - val color by ColorSetting("Color", "Example color setting", Color.WHITE.rgb) - val keyBind by KeyBindSetting("KeyBind", "Example keybind setting", GLFW.GLFW_KEY_ESCAPE) - val mode by ModeSetting("Mode", "Example mode setting", 0, arrayOf("Mode1", "Mode2", "Mode3")) - val range by RangeSetting("Range", "Example range setting", Pair(3.0, 5.0), 0.0, 10.0) - val slider by SliderSetting("Slider", "Example slider setting", 3.0, 1.0, 10.0) - val text by TextSetting("Text", "Example text setting", "Hello") + val checkbox by CheckboxSetting( + name = "Checkbox", + description = "Example checkbox setting", + subcategory = "General", + defaultValue = true + ) + + val color by ColorSetting( + name = "Color", + description = "Example color setting", + subcategory = "Appearance", + defaultValue = Color.WHITE.rgb + ) + + val keyBind by KeyBindSetting( + name = "KeyBind", + description = "Example keybind setting", + subcategory = "Controls", + defaultValue = GLFW.GLFW_KEY_ESCAPE + ) + + val mode by ModeSetting( + name = "Mode", + description = "Example mode setting", + subcategory = "Modes", + defaultValue = 0, + options = arrayOf("Mode1", "Mode2", "Mode3") + ) + + val range by RangeSetting( + name = "Range", + description = "Example range setting", + subcategory = "Numbers", + defaultValue = Pair(3.0, 5.0), + min = 0.0, + max = 10.0 + ) + + val slider by SliderSetting( + name = "Slider", + description = "Example slider setting", + subcategory = "Numbers", + defaultValue = 3.0, + min = 1.0, + max = 10.0 + ) + + val text by TextSetting( + name = "Text", + description = "Example text setting", + subcategory = "General", + defaultValue = "Hello" + ) override fun onEnable() { println("Enabled") @@ -26,5 +71,4 @@ object ExampleModule : Module( override fun onDisable() { println("Disabled") } - } diff --git a/src/main/resources/assets/exampleaddon/icon.svg b/src/main/resources/assets/exampleaddon/icon.svg deleted file mode 100644 index 5217eb0..0000000 --- a/src/main/resources/assets/exampleaddon/icon.svg +++ /dev/null @@ -1 +0,0 @@ - diff --git a/src/main/resources/cobalt.addon.json b/src/main/resources/cobalt.addon.json index c119b19..30feafb 100644 --- a/src/main/resources/cobalt.addon.json +++ b/src/main/resources/cobalt.addon.json @@ -2,9 +2,10 @@ "id": "example_addon", "name": "Example Addon", "version": "1.0.0", - "author": "quiteboring", - "description": "example addon.", "entrypoints": [ "com.example.ExampleAddon" + ], + "mixins": [ + "exampleaddon.mixins.json" ] }