-
Notifications
You must be signed in to change notification settings - Fork 65
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13 from ElNounch/fixGuiGameOver
Fix GT-New-Horizons-Modpack#7789 - Game Over GUI buttons disabled if …
- Loading branch information
Showing
3 changed files
with
36 additions
and
1 deletion.
There are no files selected for viewing
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
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
29 changes: 29 additions & 0 deletions
29
src/main/java/com/mitchej123/hodgepodge/mixins/fixGuiGameOver/gui/MixinGuiGameOver.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,29 @@ | ||
package com.mitchej123.hodgepodge.mixins.fixGuiGameOver; | ||
|
||
import net.minecraft.client.gui.GuiGameOver; | ||
|
||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.Shadow; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Inject; | ||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; | ||
|
||
@Mixin(GuiGameOver.class) | ||
public class MixinGuiGameOver { | ||
|
||
// Number of ticks screen was open | ||
@Shadow | ||
private int field_146347_a; | ||
|
||
/** | ||
* @author ElNounch | ||
* @reason Fix Game Over GUI buttons disabled if switching fullscreen | ||
*/ | ||
@Inject(method = "initGui", at = @At("HEAD")) | ||
public void resetedInitGui(CallbackInfo ci) { | ||
if (field_146347_a > 19) { | ||
// Make sure buttons will be re-enabled next tick | ||
field_146347_a = 19; | ||
} | ||
} | ||
} |