TheKodeToad/loading-fixes #7

Merged
owlsys merged 5 commits from TheKodeToad/loading-fixes into main 2024-05-24 16:03:37 -04:00
2 changed files with 28 additions and 1 deletions
Showing only changes of commit 798fc26fe4 - Show all commits

View file

@ -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);
}
}

View file

@ -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
} }