update to sun 1.2.1 / minecraft 1.21.7

This commit is contained in:
Shrecknt 2025-07-11 08:09:16 -07:00
parent 6370be47bf
commit e96bc389ff
6 changed files with 24 additions and 26 deletions

View file

@ -1,7 +1,7 @@
import java.util.* import java.util.*
plugins { plugins {
id("fabric-loom") version "1.7-SNAPSHOT" id("fabric-loom") version "1.11-SNAPSHOT"
} }
base { base {
@ -21,6 +21,10 @@ repositories {
name = "meteor-maven" name = "meteor-maven"
} }
maven("https://maven.xpple.dev/maven2") {
name = "xpple-maven"
}
maven("https://maven.shrecked.dev/private") { maven("https://maven.shrecked.dev/private") {
name = "shweccyMavenPrivate" name = "shweccyMavenPrivate"
@ -46,8 +50,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.xpple:clientarguments:${project.property("clientarguments_version")}")
modImplementation("dev.shrecked.sun:sorry_im_under_nda:${project.property("sun_version")}") modImplementation("dev.shrecked.sun:sun:${project.property("sun_version")}")
implementation("meteordevelopment:orbit:${project.property("orbit_version")}") implementation("meteordevelopment:orbit:${project.property("orbit_version")}")
implementation("io.github.racoondog:norbit:${project.property("norbit_version")}") implementation("io.github.racoondog:norbit:${project.property("norbit_version")}")
} }

View file

@ -4,9 +4,9 @@ org.gradle.parallel=true
# Fabric Properties # Fabric Properties
# check these on https://fabricmc.net/develop # check these on https://fabricmc.net/develop
minecraft_version=1.21.4 minecraft_version=1.21.7
yarn_mappings=1.21.4+build.1 yarn_mappings=1.21.7+build.6
loader_version=0.16.9 loader_version=0.16.14
# Mod Properties # Mod Properties
mod_version=1.0.0 mod_version=1.0.0
@ -14,7 +14,8 @@ maven_group=com.example
archives_base_name=sun-addon-template archives_base_name=sun-addon-template
# Dependencies # Dependencies
fabric_version=0.111.0+1.21.4 sun_version=1.2.1
sun_version=1.2.0
orbit_version=0.2.4 orbit_version=0.2.4
norbit_version=1.2.0 norbit_version=1.2.0
fabric_version=0.129.0+1.21.7
clientarguments_version=1.11.3

View file

@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip
networkTimeout=10000 networkTimeout=10000
validateDistributionUrl=true validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME

View file

@ -1,34 +1,30 @@
package com.example; package com.example;
import com.mojang.logging.LogUtils; import com.mojang.logging.LogUtils;
import dev.shrecked.sun.SunMod;
import dev.shrecked.sun.components.SunAddonInitializer; import dev.shrecked.sun.components.SunAddonInitializer;
import dev.shrecked.sun.components.command.Command;
import dev.shrecked.sun.components.command.CommandRegistry; import dev.shrecked.sun.components.command.CommandRegistry;
import dev.shrecked.sun.components.module.Module;
import dev.shrecked.sun.components.module.ModuleRegistry; import dev.shrecked.sun.components.module.ModuleRegistry;
import org.slf4j.Logger; import org.slf4j.Logger;
import java.lang.invoke.MethodHandles; import java.lang.invoke.MethodHandles;
import java.util.List;
public class ExampleAddon implements SunAddonInitializer { public class ExampleAddon implements SunAddonInitializer {
public static final Logger LOGGER = LogUtils.getLogger(); public static final Logger LOGGER = LogUtils.getLogger();
@Override @Override
public void onInitialize() { public void onInitialize() {
ModuleRegistry.NORBIT.registerLambdaFactory("com.example", (lookupInMethod, klass) -> (MethodHandles.Lookup) lookupInMethod.invoke(null, klass, MethodHandles.lookup())); SunMod.NORBIT.registerLambdaFactory("com.example", (lookupInMethod, klass) -> (MethodHandles.Lookup) lookupInMethod.invoke(null, klass, MethodHandles.lookup()));
LOGGER.info("Sun example addon initialized!"); LOGGER.info("Sun example addon initialized!");
} }
@Override @Override
public List<Module> loadModules() { public void loadModules() {
ModuleRegistry.reflectModulesFrom("com.example.modules"); ModuleRegistry.reflectModulesFrom("com.example.modules");
return List.of();
} }
@Override @Override
public List<Command> loadCommands() { public void loadCommands() {
CommandRegistry.reflectCommandsFrom("com.example.commands"); CommandRegistry.reflectCommandsFrom("com.example.commands");
return List.of();
} }
} }

View file

@ -2,22 +2,20 @@ 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.sun.components.annotation.SunCommand;
import dev.shrecked.sun.components.command.Command; import dev.shrecked.sun.components.command.Command;
import dev.shrecked.sun.util.ChatUtil; import dev.shrecked.sun.util.ChatUtil;
import net.minecraft.command.CommandSource; import net.minecraft.command.CommandSource;
@SunCommand(name = "example-command", alias = {"ex"})
public class ExampleCommand extends Command { public class ExampleCommand extends Command {
public ExampleCommand() {
super("example-command", "ex");
}
@Override @Override
public void build(LiteralArgumentBuilder<CommandSource> builder) { public void build(LiteralArgumentBuilder<CommandSource> builder) {
builder.then(literal("echo") builder.then(literal("echo")
.then(argument("text", StringArgumentType.greedyString()).executes(context -> { .then(argument("text", StringArgumentType.greedyString()).executes(context -> {
String text = context.getArgument("text", String.class); String text = context.getArgument("text", String.class);
ChatUtil.info(String.format("echo! %s", text)); ChatUtil.info(String.format("echo! %s", text));
return com.mojang.brigadier.Command.SINGLE_SUCCESS; return SINGLE_SUCCESS;
})) }))
).build(); ).build();
} }

View file

@ -1,6 +1,7 @@
package com.example.modules; package com.example.modules;
import com.example.ExampleAddon; import com.example.ExampleAddon;
import dev.shrecked.sun.components.annotation.SunModule;
import dev.shrecked.sun.components.event.Events; import dev.shrecked.sun.components.event.Events;
import dev.shrecked.sun.components.module.Category; import dev.shrecked.sun.components.module.Category;
import dev.shrecked.sun.components.module.Module; import dev.shrecked.sun.components.module.Module;
@ -10,12 +11,9 @@ import net.minecraft.client.MinecraftClient;
import java.awt.*; import java.awt.*;
@SunModule(key = "example-module", category = Category.World.class)
public class ExampleModule extends Module { public class ExampleModule extends Module {
private final StringSetting text = this.config.newStringSetting("text", "Example text display!"); private final StringSetting text = config.add("text", new StringSetting("Example text display!"));
public ExampleModule() {
super(Category.World, "example-module");
}
@Override @Override
protected void onEnable() { protected void onEnable() {