aboutsummaryrefslogtreecommitdiff
path: root/common/src/main/kotlin/net/examplemod/mixin/MixinTitleScreen.kt
blob: 0b7e009db1de54dbcd3d8dac81cfa3614c714b86 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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
    }

}