From 35ae850a9ec9a4595d399665d144bf8e408d36c1 Mon Sep 17 00:00:00 2001 From: PeytonPlayz595 <106421860+PeytonPlayz595@users.noreply.github.com> Date: Fri, 31 May 2024 18:33:17 -0400 Subject: [PATCH] fullbright --- .../client/settings/GameSettings.java | 19 +++++++++++++++++-- .../net/PeytonPlayz585/shadow/GuiShadow.java | 2 +- .../client/renderer/EntityRenderer.java | 7 ++++++- .../client/settings/GameSettings.java | 17 ++++++++++++++++- 4 files changed, 40 insertions(+), 5 deletions(-) diff --git a/src/lwjgl/java/net/minecraft/client/settings/GameSettings.java b/src/lwjgl/java/net/minecraft/client/settings/GameSettings.java index 6f1ead7..0480d7d 100644 --- a/src/lwjgl/java/net/minecraft/client/settings/GameSettings.java +++ b/src/lwjgl/java/net/minecraft/client/settings/GameSettings.java @@ -267,6 +267,7 @@ public class GameSettings { public boolean ofSmoothBiomes = true; public boolean ofCustomColors = true; public boolean hidePassword = true; + public boolean fullBright = false; public boolean enableFNAWSkins = true; public int voiceListenRadius = 16; @@ -913,6 +914,10 @@ public class GameSettings { if (parOptions == GameSettings.Options.EAGLER_VSYNC) { this.enableVsync = !this.enableVsync; } + + if(parOptions == GameSettings.Options.FULLBRIGHT) { + this.fullBright = !this.fullBright; + } this.saveOptions(); } @@ -1040,6 +1045,8 @@ public class GameSettings { return this.enableFNAWSkins; case EAGLER_VSYNC: return this.enableVsync; + case FULLBRIGHT: + return this.fullBright; default: return false; } @@ -1318,7 +1325,9 @@ public class GameSettings { } else if (parOptions == GameSettings.Options.CUSTOM_COLORS) { return this.ofCustomColors ? s + Lang.getOn() : s + Lang.getOff(); } else if (parOptions == GameSettings.Options.HIDE_PASSWORD) { - return hidePassword ? s + "ON" : s + "OFF"; + return this.hidePassword ? s + Lang.getOn() : s + Lang.getOff(); + } else if (parOptions == GameSettings.Options.FULLBRIGHT) { + return this.fullBright ? s + Lang.getOn() : s + Lang.getOff(); } else { return s; } @@ -1905,6 +1914,10 @@ public class GameSettings { if (astring[0].equals("voicePTTKey")) { voicePTTKey = Integer.parseInt(astring[1]); } + + if (astring[0].equals("fullbright") && astring.length >= 2) { + fullBright = Boolean.valueOf(astring[1]).booleanValue(); + } for (SoundCategory soundcategory : SoundCategory._VALUES) { if (astring[0].equals("soundCategory_" + soundcategory.getCategoryName())) { @@ -2099,6 +2112,7 @@ public class GameSettings { printwriter.println("voiceSpeakVolume:" + this.voiceSpeakVolume); printwriter.println("voicePTTKey:" + this.voicePTTKey); printwriter.println("enableFNAWSkins:" + this.enableFNAWSkins); + printwriter.println("fullbright:" + this.fullBright); for (KeyBinding keybinding : this.keyBindings) { printwriter.println("key_" + keybinding.getKeyDescription() + ":" + keybinding.getKeyCode()); @@ -2310,7 +2324,8 @@ public class GameSettings { CUSTOM_COLORS("Custom Colors", false, false), HIDE_PASSWORD("Hide Password", false, false), FNAW_SKINS("options.skinCustomisation.enableFNAWSkins", false, true), - EAGLER_VSYNC("options.vsync", false, true); + EAGLER_VSYNC("options.vsync", false, true), + FULLBRIGHT("Fullbright", false, true); private final boolean enumFloat; private final boolean enumBoolean; diff --git a/src/main/java/net/PeytonPlayz585/shadow/GuiShadow.java b/src/main/java/net/PeytonPlayz585/shadow/GuiShadow.java index e5834ae..c7f7581 100644 --- a/src/main/java/net/PeytonPlayz585/shadow/GuiShadow.java +++ b/src/main/java/net/PeytonPlayz585/shadow/GuiShadow.java @@ -9,7 +9,7 @@ import net.minecraft.client.settings.GameSettings; public class GuiShadow extends GuiScreen { - private static GameSettings.Options[] enumOptions = new GameSettings.Options[] {GameSettings.Options.TOGGLE_SPRINT, GameSettings.Options.CHUNK_BORDERS, GameSettings.Options.HIDE_PASSWORD}; + private static GameSettings.Options[] enumOptions = new GameSettings.Options[] {GameSettings.Options.TOGGLE_SPRINT, GameSettings.Options.CHUNK_BORDERS, GameSettings.Options.HIDE_PASSWORD, GameSettings.Options.FULLBRIGHT}; private GuiScreen parentScreen; protected String title; diff --git a/src/main/java/net/minecraft/client/renderer/EntityRenderer.java b/src/main/java/net/minecraft/client/renderer/EntityRenderer.java index 3c9693c..490a561 100644 --- a/src/main/java/net/minecraft/client/renderer/EntityRenderer.java +++ b/src/main/java/net/minecraft/client/renderer/EntityRenderer.java @@ -864,7 +864,12 @@ public class EntityRenderer implements IResourceManagerReloadListener { f10 = 1.0F; } - float f16 = this.mc.gameSettings.gammaSetting; + float f16; + if(this.mc.gameSettings.fullBright) { + f16 = 100F; + } else { + f16 = this.mc.gameSettings.gammaSetting; + } float f17 = 1.0F - f8; float f13 = 1.0F - f9; float f14 = 1.0F - f10; diff --git a/src/teavm/java/net/minecraft/client/settings/GameSettings.java b/src/teavm/java/net/minecraft/client/settings/GameSettings.java index ff6e6c4..fc39b27 100644 --- a/src/teavm/java/net/minecraft/client/settings/GameSettings.java +++ b/src/teavm/java/net/minecraft/client/settings/GameSettings.java @@ -270,6 +270,7 @@ public class GameSettings extends ModData { public boolean ofCustomColors = true; public boolean hidePassword = true; public boolean enableFNAWSkins = true; + public boolean fullBright = false; public int voiceListenRadius = 16; public float voiceListenVolume = 0.5f; @@ -1077,6 +1078,10 @@ public class GameSettings extends ModData { if (parOptions == GameSettings.Options.EAGLER_VSYNC) { this.enableVsync = !this.enableVsync; } + + if(parOptions == GameSettings.Options.FULLBRIGHT) { + this.fullBright = !this.fullBright; + } this.saveOptions(); } @@ -1202,6 +1207,8 @@ public class GameSettings extends ModData { return this.enableFNAWSkins; case EAGLER_VSYNC: return this.enableVsync; + case FULLBRIGHT: + return this.fullBright; default: return false; } @@ -1481,6 +1488,8 @@ public class GameSettings extends ModData { return this.ofCustomColors ? s + Lang.getOn() : s + Lang.getOff(); } else if (parOptions == GameSettings.Options.HIDE_PASSWORD) { return hidePassword ? s + "ON" : s + "OFF"; + } else if (parOptions == GameSettings.Options.FULLBRIGHT) { + return this.fullBright ? s + Lang.getOn() : s + Lang.getOff(); } else { return s; } @@ -2067,6 +2076,10 @@ public class GameSettings extends ModData { if (astring[0].equals("voicePTTKey")) { voicePTTKey = Integer.parseInt(astring[1]); } + + if (astring[0].equals("fullbright") && astring.length >= 2) { + fullBright = Boolean.valueOf(astring[1]).booleanValue(); + } for (SoundCategory soundcategory : SoundCategory._VALUES) { if (astring[0].equals("soundCategory_" + soundcategory.getCategoryName())) { @@ -2261,6 +2274,7 @@ public class GameSettings extends ModData { printwriter.println("voiceSpeakVolume:" + this.voiceSpeakVolume); printwriter.println("voicePTTKey:" + this.voicePTTKey); printwriter.println("enableFNAWSkins:" + this.enableFNAWSkins); + printwriter.println("fullbright:" + this.fullBright); for (KeyBinding keybinding : this.keyBindings) { printwriter.println("key_" + keybinding.getKeyDescription() + ":" + keybinding.getKeyCode()); @@ -2472,7 +2486,8 @@ public class GameSettings extends ModData { CUSTOM_COLORS("Custom Colors", false, false), HIDE_PASSWORD("Hide Password", false, false), FNAW_SKINS("options.skinCustomisation.enableFNAWSkins", false, true), - EAGLER_VSYNC("options.vsync", false, true); + EAGLER_VSYNC("options.vsync", false, true), + FULLBRIGHT("Fullbright", false, true); private final boolean enumFloat; private final boolean enumBoolean;