update to sun 1.2.1 / minecraft 1.21.7
This commit is contained in:
parent
6370be47bf
commit
e96bc389ff
6 changed files with 24 additions and 26 deletions
|
@ -1,7 +1,7 @@
|
|||
import java.util.*
|
||||
|
||||
plugins {
|
||||
id("fabric-loom") version "1.7-SNAPSHOT"
|
||||
id("fabric-loom") version "1.11-SNAPSHOT"
|
||||
}
|
||||
|
||||
base {
|
||||
|
@ -21,6 +21,10 @@ repositories {
|
|||
name = "meteor-maven"
|
||||
}
|
||||
|
||||
maven("https://maven.xpple.dev/maven2") {
|
||||
name = "xpple-maven"
|
||||
}
|
||||
|
||||
maven("https://maven.shrecked.dev/private") {
|
||||
name = "shweccyMavenPrivate"
|
||||
|
||||
|
@ -46,8 +50,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.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("io.github.racoondog:norbit:${project.property("norbit_version")}")
|
||||
}
|
||||
|
|
|
@ -4,9 +4,9 @@ org.gradle.parallel=true
|
|||
|
||||
# Fabric Properties
|
||||
# check these on https://fabricmc.net/develop
|
||||
minecraft_version=1.21.4
|
||||
yarn_mappings=1.21.4+build.1
|
||||
loader_version=0.16.9
|
||||
minecraft_version=1.21.7
|
||||
yarn_mappings=1.21.7+build.6
|
||||
loader_version=0.16.14
|
||||
|
||||
# Mod Properties
|
||||
mod_version=1.0.0
|
||||
|
@ -14,7 +14,8 @@ maven_group=com.example
|
|||
archives_base_name=sun-addon-template
|
||||
|
||||
# Dependencies
|
||||
fabric_version=0.111.0+1.21.4
|
||||
sun_version=1.2.0
|
||||
sun_version=1.2.1
|
||||
orbit_version=0.2.4
|
||||
norbit_version=1.2.0
|
||||
fabric_version=0.129.0+1.21.7
|
||||
clientarguments_version=1.11.3
|
||||
|
|
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
|
@ -1,6 +1,6 @@
|
|||
distributionBase=GRADLE_USER_HOME
|
||||
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
|
||||
validateDistributionUrl=true
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
|
|
|
@ -1,34 +1,30 @@
|
|||
package com.example;
|
||||
|
||||
import com.mojang.logging.LogUtils;
|
||||
import dev.shrecked.sun.SunMod;
|
||||
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.module.Module;
|
||||
import dev.shrecked.sun.components.module.ModuleRegistry;
|
||||
import org.slf4j.Logger;
|
||||
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.util.List;
|
||||
|
||||
public class ExampleAddon implements SunAddonInitializer {
|
||||
public static final Logger LOGGER = LogUtils.getLogger();
|
||||
|
||||
@Override
|
||||
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!");
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Module> loadModules() {
|
||||
public void loadModules() {
|
||||
ModuleRegistry.reflectModulesFrom("com.example.modules");
|
||||
return List.of();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Command> loadCommands() {
|
||||
public void loadCommands() {
|
||||
CommandRegistry.reflectCommandsFrom("com.example.commands");
|
||||
return List.of();
|
||||
}
|
||||
}
|
|
@ -2,22 +2,20 @@ package com.example.commands;
|
|||
|
||||
import com.mojang.brigadier.arguments.StringArgumentType;
|
||||
import com.mojang.brigadier.builder.LiteralArgumentBuilder;
|
||||
import dev.shrecked.sun.components.annotation.SunCommand;
|
||||
import dev.shrecked.sun.components.command.Command;
|
||||
import dev.shrecked.sun.util.ChatUtil;
|
||||
import net.minecraft.command.CommandSource;
|
||||
|
||||
@SunCommand(name = "example-command", alias = {"ex"})
|
||||
public class ExampleCommand extends Command {
|
||||
public ExampleCommand() {
|
||||
super("example-command", "ex");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void build(LiteralArgumentBuilder<CommandSource> builder) {
|
||||
builder.then(literal("echo")
|
||||
.then(argument("text", StringArgumentType.greedyString()).executes(context -> {
|
||||
String text = context.getArgument("text", String.class);
|
||||
ChatUtil.info(String.format("echo! %s", text));
|
||||
return com.mojang.brigadier.Command.SINGLE_SUCCESS;
|
||||
return SINGLE_SUCCESS;
|
||||
}))
|
||||
).build();
|
||||
}
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package com.example.modules;
|
||||
|
||||
import com.example.ExampleAddon;
|
||||
import dev.shrecked.sun.components.annotation.SunModule;
|
||||
import dev.shrecked.sun.components.event.Events;
|
||||
import dev.shrecked.sun.components.module.Category;
|
||||
import dev.shrecked.sun.components.module.Module;
|
||||
|
@ -10,12 +11,9 @@ import net.minecraft.client.MinecraftClient;
|
|||
|
||||
import java.awt.*;
|
||||
|
||||
@SunModule(key = "example-module", category = Category.World.class)
|
||||
public class ExampleModule extends Module {
|
||||
private final StringSetting text = this.config.newStringSetting("text", "Example text display!");
|
||||
|
||||
public ExampleModule() {
|
||||
super(Category.World, "example-module");
|
||||
}
|
||||
private final StringSetting text = config.add("text", new StringSetting("Example text display!"));
|
||||
|
||||
@Override
|
||||
protected void onEnable() {
|
||||
|
|
Loading…
Add table
Reference in a new issue