-
Notifications
You must be signed in to change notification settings - Fork 34
Expand file tree
/
Copy pathVideoModeFixMixin.java
More file actions
35 lines (31 loc) · 1.21 KB
/
VideoModeFixMixin.java
File metadata and controls
35 lines (31 loc) · 1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
package link.infra.borderlessmining.mixin;
import net.minecraft.client.gui.screen.Screen;
import net.minecraft.client.gui.screen.option.GameOptionsScreen;
import net.minecraft.client.gui.screen.option.VideoOptionsScreen;
import net.minecraft.client.option.GameOptions;
import net.minecraft.text.Text;
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;
/**
* This Mixin fixes a bug in Keyboard that causes video mode changes to not be applied when pressing Esc.
* See: https://bugs.mojang.com/browse/MC-175437
*/
@Mixin(VideoOptionsScreen.class)
public class VideoModeFixMixin extends GameOptionsScreen {
private VideoModeFixMixin(Screen parent, GameOptions gameOptions, Text title) {
super(parent, gameOptions, title);
}
@Inject(at = @At("HEAD"), method = "removed()V")
public void screenRemoved(CallbackInfo ci) {
if (this.client != null) {
this.client.getWindow().applyVideoMode();
}
}
@Override
protected void addOptions() {
// TODO Auto-generated method stub
throw new UnsupportedOperationException("Unimplemented method 'addOptions'");
}
}