From 01191fca8b4b34c5e0e022f2d1b4c37000217f75 Mon Sep 17 00:00:00 2001 From: Shrecknt Date: Mon, 19 Aug 2024 07:51:39 -0700 Subject: [PATCH] update to latest sun version --- build.gradle.kts | 19 ++++++++++++------- gradle.properties | 4 +++- src/main/java/com/example/ExampleAddon.java | 18 ++++++------------ .../com/example/commands/ExampleCommand.java | 4 ++-- .../com/example/modules/ExampleModule.java | 8 ++++---- 5 files changed, 27 insertions(+), 26 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 3d9f5e2..cdc9a6b 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,3 +1,5 @@ +import java.util.* + plugins { id("fabric-loom") version "1.7-SNAPSHOT" } @@ -22,13 +24,16 @@ repositories { maven("https://maven.shrecked.dev/private") { name = "shweccyMavenPrivate" - credentials { - username = "username" - password = "password" + credentials(HttpHeaderCredentials::class) { + val alias = project.property("shweccy_maven_alias").toString() + val token = project.property("shweccy_maven_token").toString() + val basic = Base64.getEncoder().encodeToString("${alias}:${token}".toByteArray()) + name = "Authorization" + value = "Basic $basic" } authentication { - create("basic") + create("header") } } } @@ -42,9 +47,9 @@ dependencies { // Fabric API. This is technically optional, but you probably want it anyway. modImplementation("net.fabricmc.fabric-api:fabric-api:${project.property("fabric_version")}") - modImplementation("dev.shrecked:sun:${project.property("sun_version")}") - implementation("meteordevelopment:orbit:0.2.4") - implementation("io.github.racoondog:norbit:1.2.0") + modImplementation("dev.shrecked.sun:sorry_im_under_nda:${project.property("sun_version")}") + implementation("meteordevelopment:orbit:${project.property("orbit_version")}") + implementation("io.github.racoondog:norbit:${project.property("norbit_version")}") } tasks { diff --git a/gradle.properties b/gradle.properties index 6fccee6..201d1c7 100644 --- a/gradle.properties +++ b/gradle.properties @@ -15,4 +15,6 @@ archives_base_name=sun-addon-template # Dependencies fabric_version=0.102.0+1.21.1 -sun_version=1.1.0 +sun_version=1.1.2 +orbit_version=0.2.4 +norbit_version=1.2.0 diff --git a/src/main/java/com/example/ExampleAddon.java b/src/main/java/com/example/ExampleAddon.java index 56c279c..33d7c87 100644 --- a/src/main/java/com/example/ExampleAddon.java +++ b/src/main/java/com/example/ExampleAddon.java @@ -1,12 +1,8 @@ package com.example; -import com.example.commands.ExampleCommand; -import com.example.modules.ExampleModule; import com.mojang.logging.LogUtils; -import dev.shrecked.components.Command; -import dev.shrecked.components.Module; -import dev.shrecked.components.ModuleRegistry; -import dev.shrecked.components.SunAddonInitializer; +import dev.shrecked.sun.components.*; +import dev.shrecked.sun.components.Module; import org.slf4j.Logger; import java.lang.invoke.MethodHandles; @@ -23,15 +19,13 @@ public class ExampleAddon implements SunAddonInitializer { @Override public List loadModules() { - return List.of(new Module[]{ - new ExampleModule() - }); + ModuleRegistry.reflectModulesFrom("com.example.modules"); + return List.of(); } @Override public List loadCommands() { - return List.of(new Command[]{ - new ExampleCommand() - }); + CommandRegistry.reflectCommandsFrom("com.example.commands"); + return List.of(); } } \ No newline at end of file diff --git a/src/main/java/com/example/commands/ExampleCommand.java b/src/main/java/com/example/commands/ExampleCommand.java index 1b6c580..f048343 100644 --- a/src/main/java/com/example/commands/ExampleCommand.java +++ b/src/main/java/com/example/commands/ExampleCommand.java @@ -2,8 +2,8 @@ package com.example.commands; import com.mojang.brigadier.arguments.StringArgumentType; import com.mojang.brigadier.builder.LiteralArgumentBuilder; -import dev.shrecked.components.Command; -import dev.shrecked.util.ChatUtil; +import dev.shrecked.sun.components.Command; +import dev.shrecked.sun.util.ChatUtil; import net.minecraft.command.CommandSource; public class ExampleCommand extends Command { diff --git a/src/main/java/com/example/modules/ExampleModule.java b/src/main/java/com/example/modules/ExampleModule.java index caf0a08..66c3282 100644 --- a/src/main/java/com/example/modules/ExampleModule.java +++ b/src/main/java/com/example/modules/ExampleModule.java @@ -1,10 +1,10 @@ package com.example.modules; import com.example.ExampleAddon; -import dev.shrecked.components.Category; -import dev.shrecked.components.Event; -import dev.shrecked.components.Module; -import dev.shrecked.components.settings.StringSetting; +import dev.shrecked.sun.components.Category; +import dev.shrecked.sun.components.Event; +import dev.shrecked.sun.components.Module; +import dev.shrecked.sun.components.settings.StringSetting; import meteordevelopment.orbit.EventHandler; import net.minecraft.client.MinecraftClient;