Skip to content

Commit

Permalink
Fix MC-68754
Browse files Browse the repository at this point in the history
  • Loading branch information
embeddedt committed Oct 22, 2023
1 parent 04540ca commit 97eb287
Showing 1 changed file with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
import net.minecraft.client.multiplayer.WorldClient;
import net.minecraft.client.settings.GameSettings;
import net.minecraft.server.integrated.IntegratedServer;
import net.minecraft.util.Util;
import org.lwjgl.opengl.Display;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
Expand All @@ -23,6 +25,8 @@ public abstract class MixinMinecraft {

@Shadow public GuiScreen currentScreen;

@Shadow private boolean fullscreen;

/** @reason Makes grass display as fancy regardless of the graphics setting. Matches the appearance of 1.8+ */
@Redirect(method = "runGameLoop", at = @At(value = "FIELD", target = "Lnet/minecraft/client/settings/GameSettings;fancyGraphics:Z"))
private boolean getFancyGrass(GameSettings gameSettings) {
Expand Down Expand Up @@ -65,4 +69,16 @@ private void checkServerStopped(CallbackInfo ci) {
private boolean alwaysHaveDisplayActive() {
return true;
}

/**
* @author embeddedt
* @reason fix MC-68754
*/
@Inject(method = "toggleFullscreen", at = @At("RETURN"))
private void resetResizeableFlag(CallbackInfo ci) {
if (!this.fullscreen && Util.getOSType() == Util.EnumOS.WINDOWS) {
Display.setResizable(false);
Display.setResizable(true);
}
}
}

0 comments on commit 97eb287

Please sign in to comment.