diff options
| author | isxander <xander@isxander.dev> | 2024-04-11 18:43:06 +0100 |
|---|---|---|
| committer | isxander <xander@isxander.dev> | 2024-04-11 18:43:06 +0100 |
| commit | 04fe933f4c24817100f3101f088accf55a621f8a (patch) | |
| tree | feff94ca3ab4484160e69a24f4ee38522381950e /src/testmod/java/dev/isxander/yacl3/test/mixin | |
| parent | 831b894fdb7fe3e173d81387c8f6a2402b8ccfa9 (diff) | |
| download | YetAnotherConfigLib-04fe933f4c24817100f3101f088accf55a621f8a.tar.gz YetAnotherConfigLib-04fe933f4c24817100f3101f088accf55a621f8a.tar.bz2 YetAnotherConfigLib-04fe933f4c24817100f3101f088accf55a621f8a.zip | |
Extremely fragile and broken multiversion build with stonecutter
Diffstat (limited to 'src/testmod/java/dev/isxander/yacl3/test/mixin')
| -rw-r--r-- | src/testmod/java/dev/isxander/yacl3/test/mixin/TitleScreenMixin.java | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/testmod/java/dev/isxander/yacl3/test/mixin/TitleScreenMixin.java b/src/testmod/java/dev/isxander/yacl3/test/mixin/TitleScreenMixin.java new file mode 100644 index 0000000..c3fddbc --- /dev/null +++ b/src/testmod/java/dev/isxander/yacl3/test/mixin/TitleScreenMixin.java @@ -0,0 +1,25 @@ +package dev.isxander.yacl3.test.mixin; + +import dev.isxander.yacl3.test.GuiTest; +import net.minecraft.client.gui.components.Button; +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 = "init", at = @At("RETURN")) + private void addButton(CallbackInfo ci) { + addRenderableWidget(Button.builder(Component.literal("YetAnotherConfigLib Test"), button -> { + minecraft.setScreen(GuiTest.getModConfigScreenFactory(minecraft.screen)); + }).width(150).build()); + } +} |
