Search in sources :

Example 1 with At

use of org.spongepowered.asm.mixin.injection.At in project Almura by AlmuraDev.

the class MixinGuiOptions method onInitGui.

// Add our button to the list and move the Done button lower
@Inject(method = "initGui", at = @At("RETURN"))
public void onInitGui(CallbackInfo ci) {
    final GuiButton almuraButton = new GuiButton(301, this.width / 2 - 155, this.height / 6 + 144 - 6, 150, 20, "Almura");
    this.buttonList.add(almuraButton);
    /*
         * Button IDs                     Buttons
         * 108                          = Difficulty
         * 109                          = Lock
         * REALMS_NOTIFICATIONS ordinal = Realms notification
         * 200                          = Done
         */
    // Move every button that isn't any of the above listed up by 12
    this.buttonList.stream().filter(btn -> !(btn instanceof GuiOptionSlider) && btn.id != 200 && btn.id != 108 && btn.id != 109 && btn.id != GameSettings.Options.REALMS_NOTIFICATIONS.getOrdinal()).forEach(btn -> btn.y = btn.y - 12);
}
Also used : CallbackInfo(org.spongepowered.asm.mixin.injection.callback.CallbackInfo) GuiScreen(net.minecraft.client.gui.GuiScreen) SimpleOptionsMenu(com.almuradev.almura.feature.menu.SimpleOptionsMenu) GuiOptions(net.minecraft.client.gui.GuiOptions) GuiButton(net.minecraft.client.gui.GuiButton) Mixin(org.spongepowered.asm.mixin.Mixin) Inject(org.spongepowered.asm.mixin.injection.Inject) GameSettings(net.minecraft.client.settings.GameSettings) IOException(java.io.IOException) GuiOptionSlider(net.minecraft.client.gui.GuiOptionSlider) At(org.spongepowered.asm.mixin.injection.At) GuiOptionSlider(net.minecraft.client.gui.GuiOptionSlider) GuiButton(net.minecraft.client.gui.GuiButton) Inject(org.spongepowered.asm.mixin.injection.Inject)

Aggregations

SimpleOptionsMenu (com.almuradev.almura.feature.menu.SimpleOptionsMenu)1 IOException (java.io.IOException)1 GuiButton (net.minecraft.client.gui.GuiButton)1 GuiOptionSlider (net.minecraft.client.gui.GuiOptionSlider)1 GuiOptions (net.minecraft.client.gui.GuiOptions)1 GuiScreen (net.minecraft.client.gui.GuiScreen)1 GameSettings (net.minecraft.client.settings.GameSettings)1 Mixin (org.spongepowered.asm.mixin.Mixin)1 At (org.spongepowered.asm.mixin.injection.At)1 Inject (org.spongepowered.asm.mixin.injection.Inject)1 CallbackInfo (org.spongepowered.asm.mixin.injection.callback.CallbackInfo)1