-
-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Fix ScreenInitEvent not firing on repositioning options screen o…
…n Forge and NeoForge TwelveIterationMods/ClientTweaks#96
- Loading branch information
1 parent
2a56fc9
commit fd50ba2
Showing
4 changed files
with
52 additions
and
2 deletions.
There are no files selected for viewing
24 changes: 24 additions & 0 deletions
24
forge/src/main/java/net/blay09/mods/balm/mixin/OptionsScreenMixin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package net.blay09.mods.balm.mixin; | ||
|
||
import net.blay09.mods.balm.api.Balm; | ||
import net.blay09.mods.balm.api.event.client.screen.ScreenInitEvent; | ||
import net.minecraft.client.gui.screens.Screen; | ||
import net.minecraft.client.gui.screens.options.OptionsScreen; | ||
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(OptionsScreen.class) | ||
public class OptionsScreenMixin { | ||
@Inject(method = "repositionElements", at = @At("HEAD")) | ||
private void repositionElements(CallbackInfo ci) { | ||
Balm.getEvents().fireEvent(new ScreenInitEvent.Pre((Screen) (Object) this)); | ||
} | ||
|
||
@Inject(method = "repositionElements", at = @At("RETURN")) | ||
private void repositionElementsPost(CallbackInfo ci) { | ||
Balm.getEvents().fireEvent(new ScreenInitEvent.Post((Screen) (Object) this)); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
neoforge/src/main/java/net/blay09/mods/balm/mixin/OptionsScreenMixin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package net.blay09.mods.balm.mixin; | ||
|
||
import net.blay09.mods.balm.api.Balm; | ||
import net.blay09.mods.balm.api.event.client.screen.ScreenInitEvent; | ||
import net.minecraft.client.gui.screens.Screen; | ||
import net.minecraft.client.gui.screens.options.OptionsScreen; | ||
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(OptionsScreen.class) | ||
public class OptionsScreenMixin { | ||
@Inject(method = "repositionElements", at = @At("HEAD")) | ||
private void repositionElements(CallbackInfo ci) { | ||
Balm.getEvents().fireEvent(new ScreenInitEvent.Pre((Screen) (Object) this)); | ||
} | ||
|
||
@Inject(method = "repositionElements", at = @At("RETURN")) | ||
private void repositionElementsPost(CallbackInfo ci) { | ||
Balm.getEvents().fireEvent(new ScreenInitEvent.Post((Screen) (Object) this)); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters