Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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/")
}

Expand All @@ -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 {
Expand Down
6 changes: 3 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
Binary file removed lib/Cobalt-1.0.0.jar
Binary file not shown.
14 changes: 3 additions & 11 deletions src/main/kotlin/com/example/ExampleAddon.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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!")
}


}
3 changes: 2 additions & 1 deletion src/main/kotlin/com/example/command/ExampleCommand.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -16,7 +17,7 @@ object ExampleCommand : Command(

@SubCommand
fun hello(name: String) {
println("Hello, $name!")
ChatUtils.sendMessage("Hello, $name!")
}

}
64 changes: 54 additions & 10 deletions src/main/kotlin/com/example/module/ExampleModule.kt
Original file line number Diff line number Diff line change
@@ -1,23 +1,68 @@
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.*
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")
Expand All @@ -26,5 +71,4 @@ object ExampleModule : Module(
override fun onDisable() {
println("Disabled")
}

}
1 change: 0 additions & 1 deletion src/main/resources/assets/exampleaddon/icon.svg

This file was deleted.

5 changes: 3 additions & 2 deletions src/main/resources/cobalt.addon.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
]
}