update to latest sun version

This commit is contained in:
Shrecknt 2024-08-19 07:51:39 -07:00
parent e4997f3a4a
commit 01191fca8b
5 changed files with 27 additions and 26 deletions

View file

@ -1,3 +1,5 @@
import java.util.*
plugins { plugins {
id("fabric-loom") version "1.7-SNAPSHOT" id("fabric-loom") version "1.7-SNAPSHOT"
} }
@ -22,13 +24,16 @@ repositories {
maven("https://maven.shrecked.dev/private") { maven("https://maven.shrecked.dev/private") {
name = "shweccyMavenPrivate" name = "shweccyMavenPrivate"
credentials { credentials(HttpHeaderCredentials::class) {
username = "username" val alias = project.property("shweccy_maven_alias").toString()
password = "password" val token = project.property("shweccy_maven_token").toString()
val basic = Base64.getEncoder().encodeToString("${alias}:${token}".toByteArray())
name = "Authorization"
value = "Basic $basic"
} }
authentication { authentication {
create<BasicAuthentication>("basic") create<HttpHeaderAuthentication>("header")
} }
} }
} }
@ -42,9 +47,9 @@ dependencies {
// Fabric API. This is technically optional, but you probably want it anyway. // Fabric API. This is technically optional, but you probably want it anyway.
modImplementation("net.fabricmc.fabric-api:fabric-api:${project.property("fabric_version")}") modImplementation("net.fabricmc.fabric-api:fabric-api:${project.property("fabric_version")}")
modImplementation("dev.shrecked:sun:${project.property("sun_version")}") modImplementation("dev.shrecked.sun:sorry_im_under_nda:${project.property("sun_version")}")
implementation("meteordevelopment:orbit:0.2.4") implementation("meteordevelopment:orbit:${project.property("orbit_version")}")
implementation("io.github.racoondog:norbit:1.2.0") implementation("io.github.racoondog:norbit:${project.property("norbit_version")}")
} }
tasks { tasks {

View file

@ -15,4 +15,6 @@ archives_base_name=sun-addon-template
# Dependencies # Dependencies
fabric_version=0.102.0+1.21.1 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

View file

@ -1,12 +1,8 @@
package com.example; package com.example;
import com.example.commands.ExampleCommand;
import com.example.modules.ExampleModule;
import com.mojang.logging.LogUtils; import com.mojang.logging.LogUtils;
import dev.shrecked.components.Command; import dev.shrecked.sun.components.*;
import dev.shrecked.components.Module; import dev.shrecked.sun.components.Module;
import dev.shrecked.components.ModuleRegistry;
import dev.shrecked.components.SunAddonInitializer;
import org.slf4j.Logger; import org.slf4j.Logger;
import java.lang.invoke.MethodHandles; import java.lang.invoke.MethodHandles;
@ -23,15 +19,13 @@ public class ExampleAddon implements SunAddonInitializer {
@Override @Override
public List<Module> loadModules() { public List<Module> loadModules() {
return List.of(new Module[]{ ModuleRegistry.reflectModulesFrom("com.example.modules");
new ExampleModule() return List.of();
});
} }
@Override @Override
public List<Command> loadCommands() { public List<Command> loadCommands() {
return List.of(new Command[]{ CommandRegistry.reflectCommandsFrom("com.example.commands");
new ExampleCommand() return List.of();
});
} }
} }

View file

@ -2,8 +2,8 @@ package com.example.commands;
import com.mojang.brigadier.arguments.StringArgumentType; import com.mojang.brigadier.arguments.StringArgumentType;
import com.mojang.brigadier.builder.LiteralArgumentBuilder; import com.mojang.brigadier.builder.LiteralArgumentBuilder;
import dev.shrecked.components.Command; import dev.shrecked.sun.components.Command;
import dev.shrecked.util.ChatUtil; import dev.shrecked.sun.util.ChatUtil;
import net.minecraft.command.CommandSource; import net.minecraft.command.CommandSource;
public class ExampleCommand extends Command { public class ExampleCommand extends Command {

View file

@ -1,10 +1,10 @@
package com.example.modules; package com.example.modules;
import com.example.ExampleAddon; import com.example.ExampleAddon;
import dev.shrecked.components.Category; import dev.shrecked.sun.components.Category;
import dev.shrecked.components.Event; import dev.shrecked.sun.components.Event;
import dev.shrecked.components.Module; import dev.shrecked.sun.components.Module;
import dev.shrecked.components.settings.StringSetting; import dev.shrecked.sun.components.settings.StringSetting;
import meteordevelopment.orbit.EventHandler; import meteordevelopment.orbit.EventHandler;
import net.minecraft.client.MinecraftClient; import net.minecraft.client.MinecraftClient;