aboutsummaryrefslogtreecommitdiff
path: root/common/src/main/kotlin/net/examplemod/mixin/MixinTitleScreen.kt
diff options
context:
space:
mode:
authornea <romangraef@gmail.com>2022-07-12 14:20:22 +0200
committernea <romangraef@gmail.com>2022-07-12 14:20:22 +0200
commit372eec27e5e0c8ef796ed9e6bcdc68a10df84718 (patch)
tree425ab1a282196a68819da297c670e9170a8c514a /common/src/main/kotlin/net/examplemod/mixin/MixinTitleScreen.kt
downloadfirmament-372eec27e5e0c8ef796ed9e6bcdc68a10df84718.tar.gz
firmament-372eec27e5e0c8ef796ed9e6bcdc68a10df84718.tar.bz2
firmament-372eec27e5e0c8ef796ed9e6bcdc68a10df84718.zip
initial
Diffstat (limited to 'common/src/main/kotlin/net/examplemod/mixin/MixinTitleScreen.kt')
-rw-r--r--common/src/main/kotlin/net/examplemod/mixin/MixinTitleScreen.kt23
1 files changed, 23 insertions, 0 deletions
diff --git a/common/src/main/kotlin/net/examplemod/mixin/MixinTitleScreen.kt b/common/src/main/kotlin/net/examplemod/mixin/MixinTitleScreen.kt
new file mode 100644
index 0000000..0b7e009
--- /dev/null
+++ b/common/src/main/kotlin/net/examplemod/mixin/MixinTitleScreen.kt
@@ -0,0 +1,23 @@
+package net.examplemod.mixin
+
+import net.minecraft.client.gui.screens.TitleScreen
+import org.objectweb.asm.Opcodes
+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.Redirect
+import org.spongepowered.asm.mixin.injection.callback.CallbackInfo
+
+@Mixin(TitleScreen::class)
+class MixinTitleScreen {
+ @Inject(at = [At("HEAD")], method = ["init()V"])
+ private fun init(info: CallbackInfo) {
+ println("Hello from example architectury common mixin!")
+ }
+
+ @Redirect(method = ["render"], at = At("FIELD", target = "minceraftEasterEgg", opcode = Opcodes.GETFIELD))
+ private fun nextFloat(t: TitleScreen): Boolean {
+ return true
+ }
+
+}