Compare commits
4 commits
4ec31a0082
...
798fc26fe4
Author | SHA1 | Date | |
---|---|---|---|
moehreag | 798fc26fe4 | ||
moehreag | df66596b5e | ||
moehreag | c42681f445 | ||
moehreag | 287214acba |
|
@ -24,9 +24,9 @@ repositories {
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation(libs.remapper)
|
implementation(libs.remapper)
|
||||||
implementation("org.apache.logging.log4j:log4j-slf4j2-impl:3.0.0-beta2")
|
compileOnly("org.apache.logging.log4j:log4j-slf4j2-impl:3.0.0-beta2")
|
||||||
implementation("org.apache.logging.log4j:log4j-api:3.0.0-beta2")
|
compileOnly("org.apache.logging.log4j:log4j-api:3.0.0-beta2")
|
||||||
implementation("org.apache.logging.log4j:log4j-core:3.0.0-beta2")
|
compileOnly("org.apache.logging.log4j:log4j-core:3.0.0-beta2")
|
||||||
|
|
||||||
api(libs.mixin)
|
api(libs.mixin)
|
||||||
api(libs.nightconfig)
|
api(libs.nightconfig)
|
||||||
|
|
|
@ -0,0 +1,25 @@
|
||||||
|
package org.ecorous.esnesnon.nonsense.loader.example.mixin;
|
||||||
|
|
||||||
|
import net.minecraft.client.gui.components.FocusableTextWidget;
|
||||||
|
import net.minecraft.client.gui.screens.Screen;
|
||||||
|
import net.minecraft.client.gui.screens.TitleScreen;
|
||||||
|
import net.minecraft.network.chat.Component;
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
|
import org.spongepowered.asm.mixin.injection.Inject;
|
||||||
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||||
|
|
||||||
|
@Mixin(TitleScreen.class)
|
||||||
|
public abstract class TitleScreenMixin extends Screen {
|
||||||
|
|
||||||
|
protected TitleScreenMixin(Component title) {
|
||||||
|
super(title);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Inject(method = "createNormalMenuOptions", at = @At("TAIL"), remap = false)
|
||||||
|
private void showExample(int y, int rowHeight, CallbackInfo ci) {
|
||||||
|
var widget = new FocusableTextWidget(200, Component.literal("<insert frog here!>"), this.font);
|
||||||
|
widget.setPosition(width / 2 - widget.getWidth(), 20);
|
||||||
|
addRenderableOnly(widget);
|
||||||
|
}
|
||||||
|
}
|
|
@ -4,7 +4,9 @@
|
||||||
"package": "org.ecorous.esnesnon.nonsense.loader.example.mixin",
|
"package": "org.ecorous.esnesnon.nonsense.loader.example.mixin",
|
||||||
"compatibilityLevel": "JAVA_21",
|
"compatibilityLevel": "JAVA_21",
|
||||||
"mixins": [],
|
"mixins": [],
|
||||||
"client": [],
|
"client": [
|
||||||
|
"TitleScreenMixin"
|
||||||
|
],
|
||||||
"injectors": {
|
"injectors": {
|
||||||
"defaultRequire": 1
|
"defaultRequire": 1
|
||||||
}
|
}
|
|
@ -16,6 +16,6 @@ breaks = [
|
||||||
]
|
]
|
||||||
|
|
||||||
[nonsense.extensions]
|
[nonsense.extensions]
|
||||||
pre_launch = "org/ecorous/esnesnon/nonsense/loader/example/ExamplePreLaunchExtension"
|
pre_launch = "org.ecorous.esnesnon.nonsense.loader.example.ExamplePreLaunchExtension"
|
||||||
mixin_config = "example_mod.mixin.config"
|
mixin_config = "example_mod.mixins.json"
|
||||||
|
|
||||||
|
|
|
@ -37,6 +37,8 @@ public class Launcher {
|
||||||
instance = this;
|
instance = this;
|
||||||
this.env = env;
|
this.env = env;
|
||||||
targetClassLoader = new MixinClassLoader();
|
targetClassLoader = new MixinClassLoader();
|
||||||
|
targetClassLoader.excludePackage("org.slf4j");
|
||||||
|
targetClassLoader.excludePackage("org.spongepowered");
|
||||||
targetClassLoader.excludePackage("org.apache.logging");
|
targetClassLoader.excludePackage("org.apache.logging");
|
||||||
targetClassLoader.excludePackage("org.ecorous.esnesnon.nonsense.loader.impl.launch");
|
targetClassLoader.excludePackage("org.ecorous.esnesnon.nonsense.loader.impl.launch");
|
||||||
targetClassLoader.excludePackage("org.ecorous.esnesnon.nonsense.loader.api.env");
|
targetClassLoader.excludePackage("org.ecorous.esnesnon.nonsense.loader.api.env");
|
||||||
|
|
Loading…
Reference in a new issue