mirror of
https://github.com/barkeser2002/CatServer.git
synced 2026-09-25 09:26:08 +03:00
592 lines
24 KiB
Diff
592 lines
24 KiB
Diff
--- ../src-base/minecraft/net/minecraft/client/settings/GameSettings.java
|
|
+++ ../src-work/minecraft/net/minecraft/client/settings/GameSettings.java
|
|
@@ -165,6 +165,7 @@
|
|
|
|
public GameSettings(Minecraft mcIn, File mcDataDir)
|
|
{
|
|
+ setForgeKeybindProperties();
|
|
this.keyBindings = (KeyBinding[])ArrayUtils.addAll(new KeyBinding[] {this.keyBindAttack, this.keyBindUseItem, this.keyBindForward, this.keyBindLeft, this.keyBindBack, this.keyBindRight, this.keyBindJump, this.keyBindSneak, this.keyBindSprint, this.keyBindDrop, this.keyBindInventory, this.keyBindChat, this.keyBindPlayerList, this.keyBindPickBlock, this.keyBindCommand, this.keyBindScreenshot, this.keyBindTogglePerspective, this.keyBindSmoothCamera, this.keyBindFullscreen, this.keyBindSpectatorOutlines, this.keyBindSwapHands, this.keyBindSaveToolbar, this.keyBindLoadToolbar, this.keyBindAdvancements}, this.keyBindsHotbar);
|
|
this.difficulty = EnumDifficulty.NORMAL;
|
|
this.lastServer = "";
|
|
@@ -175,11 +176,11 @@
|
|
|
|
if (mcIn.isJava64bit() && Runtime.getRuntime().maxMemory() >= 1000000000L)
|
|
{
|
|
- GameSettings.Options.RENDER_DISTANCE.setValueMax(32.0F);
|
|
+ Options.RENDER_DISTANCE.setValueMax(32.0F);
|
|
}
|
|
else
|
|
{
|
|
- GameSettings.Options.RENDER_DISTANCE.setValueMax(16.0F);
|
|
+ Options.RENDER_DISTANCE.setValueMax(16.0F);
|
|
}
|
|
|
|
this.renderDistanceChunks = mcIn.isJava64bit() ? 12 : 8;
|
|
@@ -188,6 +189,7 @@
|
|
|
|
public GameSettings()
|
|
{
|
|
+ setForgeKeybindProperties();
|
|
this.keyBindings = (KeyBinding[])ArrayUtils.addAll(new KeyBinding[] {this.keyBindAttack, this.keyBindUseItem, this.keyBindForward, this.keyBindLeft, this.keyBindBack, this.keyBindRight, this.keyBindJump, this.keyBindSneak, this.keyBindSprint, this.keyBindDrop, this.keyBindInventory, this.keyBindChat, this.keyBindPlayerList, this.keyBindPickBlock, this.keyBindCommand, this.keyBindScreenshot, this.keyBindTogglePerspective, this.keyBindSmoothCamera, this.keyBindFullscreen, this.keyBindSpectatorOutlines, this.keyBindSwapHands, this.keyBindSaveToolbar, this.keyBindLoadToolbar, this.keyBindAdvancements}, this.keyBindsHotbar);
|
|
this.difficulty = EnumDifficulty.NORMAL;
|
|
this.lastServer = "";
|
|
@@ -237,59 +239,59 @@
|
|
this.saveOptions();
|
|
}
|
|
|
|
- public void setOptionFloatValue(GameSettings.Options settingsOption, float value)
|
|
+ public void setOptionFloatValue(Options settingsOption, float value)
|
|
{
|
|
- if (settingsOption == GameSettings.Options.SENSITIVITY)
|
|
+ if (settingsOption == Options.SENSITIVITY)
|
|
{
|
|
this.mouseSensitivity = value;
|
|
}
|
|
|
|
- if (settingsOption == GameSettings.Options.FOV)
|
|
+ if (settingsOption == Options.FOV)
|
|
{
|
|
this.fovSetting = value;
|
|
}
|
|
|
|
- if (settingsOption == GameSettings.Options.GAMMA)
|
|
+ if (settingsOption == Options.GAMMA)
|
|
{
|
|
this.gammaSetting = value;
|
|
}
|
|
|
|
- if (settingsOption == GameSettings.Options.FRAMERATE_LIMIT)
|
|
+ if (settingsOption == Options.FRAMERATE_LIMIT)
|
|
{
|
|
this.limitFramerate = (int)value;
|
|
}
|
|
|
|
- if (settingsOption == GameSettings.Options.CHAT_OPACITY)
|
|
+ if (settingsOption == Options.CHAT_OPACITY)
|
|
{
|
|
this.chatOpacity = value;
|
|
this.mc.ingameGUI.getChatGUI().refreshChat();
|
|
}
|
|
|
|
- if (settingsOption == GameSettings.Options.CHAT_HEIGHT_FOCUSED)
|
|
+ if (settingsOption == Options.CHAT_HEIGHT_FOCUSED)
|
|
{
|
|
this.chatHeightFocused = value;
|
|
this.mc.ingameGUI.getChatGUI().refreshChat();
|
|
}
|
|
|
|
- if (settingsOption == GameSettings.Options.CHAT_HEIGHT_UNFOCUSED)
|
|
+ if (settingsOption == Options.CHAT_HEIGHT_UNFOCUSED)
|
|
{
|
|
this.chatHeightUnfocused = value;
|
|
this.mc.ingameGUI.getChatGUI().refreshChat();
|
|
}
|
|
|
|
- if (settingsOption == GameSettings.Options.CHAT_WIDTH)
|
|
+ if (settingsOption == Options.CHAT_WIDTH)
|
|
{
|
|
this.chatWidth = value;
|
|
this.mc.ingameGUI.getChatGUI().refreshChat();
|
|
}
|
|
|
|
- if (settingsOption == GameSettings.Options.CHAT_SCALE)
|
|
+ if (settingsOption == Options.CHAT_SCALE)
|
|
{
|
|
this.chatScale = value;
|
|
this.mc.ingameGUI.getChatGUI().refreshChat();
|
|
}
|
|
|
|
- if (settingsOption == GameSettings.Options.MIPMAP_LEVELS)
|
|
+ if (settingsOption == Options.MIPMAP_LEVELS)
|
|
{
|
|
int i = this.mipmapLevels;
|
|
this.mipmapLevels = (int)value;
|
|
@@ -299,114 +301,114 @@
|
|
this.mc.getTextureMapBlocks().setMipmapLevels(this.mipmapLevels);
|
|
this.mc.getTextureManager().bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
|
|
this.mc.getTextureMapBlocks().setBlurMipmapDirect(false, this.mipmapLevels > 0);
|
|
- this.mc.scheduleResourcesRefresh();
|
|
+ this.needsResourceRefresh = true; // FORGE: fix for MC-64581 very laggy mipmap slider
|
|
}
|
|
}
|
|
|
|
- if (settingsOption == GameSettings.Options.RENDER_DISTANCE)
|
|
+ if (settingsOption == Options.RENDER_DISTANCE)
|
|
{
|
|
this.renderDistanceChunks = (int)value;
|
|
this.mc.renderGlobal.setDisplayListEntitiesDirty();
|
|
}
|
|
}
|
|
|
|
- public void setOptionValue(GameSettings.Options settingsOption, int value)
|
|
+ public void setOptionValue(Options settingsOption, int value)
|
|
{
|
|
- if (settingsOption == GameSettings.Options.RENDER_DISTANCE)
|
|
+ if (settingsOption == Options.RENDER_DISTANCE)
|
|
{
|
|
this.setOptionFloatValue(settingsOption, MathHelper.clamp((float)(this.renderDistanceChunks + value), settingsOption.getValueMin(), settingsOption.getValueMax()));
|
|
}
|
|
|
|
- if (settingsOption == GameSettings.Options.MAIN_HAND)
|
|
+ if (settingsOption == Options.MAIN_HAND)
|
|
{
|
|
this.mainHand = this.mainHand.opposite();
|
|
}
|
|
|
|
- if (settingsOption == GameSettings.Options.INVERT_MOUSE)
|
|
+ if (settingsOption == Options.INVERT_MOUSE)
|
|
{
|
|
this.invertMouse = !this.invertMouse;
|
|
}
|
|
|
|
- if (settingsOption == GameSettings.Options.GUI_SCALE)
|
|
+ if (settingsOption == Options.GUI_SCALE)
|
|
{
|
|
this.guiScale = this.guiScale + value & 3;
|
|
}
|
|
|
|
- if (settingsOption == GameSettings.Options.PARTICLES)
|
|
+ if (settingsOption == Options.PARTICLES)
|
|
{
|
|
this.particleSetting = (this.particleSetting + value) % 3;
|
|
}
|
|
|
|
- if (settingsOption == GameSettings.Options.VIEW_BOBBING)
|
|
+ if (settingsOption == Options.VIEW_BOBBING)
|
|
{
|
|
this.viewBobbing = !this.viewBobbing;
|
|
}
|
|
|
|
- if (settingsOption == GameSettings.Options.RENDER_CLOUDS)
|
|
+ if (settingsOption == Options.RENDER_CLOUDS)
|
|
{
|
|
this.clouds = (this.clouds + value) % 3;
|
|
}
|
|
|
|
- if (settingsOption == GameSettings.Options.FORCE_UNICODE_FONT)
|
|
+ if (settingsOption == Options.FORCE_UNICODE_FONT)
|
|
{
|
|
this.forceUnicodeFont = !this.forceUnicodeFont;
|
|
this.mc.fontRenderer.setUnicodeFlag(this.mc.getLanguageManager().isCurrentLocaleUnicode() || this.forceUnicodeFont);
|
|
}
|
|
|
|
- if (settingsOption == GameSettings.Options.FBO_ENABLE)
|
|
+ if (settingsOption == Options.FBO_ENABLE)
|
|
{
|
|
this.fboEnable = !this.fboEnable;
|
|
}
|
|
|
|
- if (settingsOption == GameSettings.Options.ANAGLYPH)
|
|
+ if (settingsOption == Options.ANAGLYPH)
|
|
{
|
|
this.anaglyph = !this.anaglyph;
|
|
this.mc.refreshResources();
|
|
}
|
|
|
|
- if (settingsOption == GameSettings.Options.GRAPHICS)
|
|
+ if (settingsOption == Options.GRAPHICS)
|
|
{
|
|
this.fancyGraphics = !this.fancyGraphics;
|
|
this.mc.renderGlobal.loadRenderers();
|
|
}
|
|
|
|
- if (settingsOption == GameSettings.Options.AMBIENT_OCCLUSION)
|
|
+ if (settingsOption == Options.AMBIENT_OCCLUSION)
|
|
{
|
|
this.ambientOcclusion = (this.ambientOcclusion + value) % 3;
|
|
this.mc.renderGlobal.loadRenderers();
|
|
}
|
|
|
|
- if (settingsOption == GameSettings.Options.CHAT_VISIBILITY)
|
|
+ if (settingsOption == Options.CHAT_VISIBILITY)
|
|
{
|
|
this.chatVisibility = EntityPlayer.EnumChatVisibility.getEnumChatVisibility((this.chatVisibility.getChatVisibility() + value) % 3);
|
|
}
|
|
|
|
- if (settingsOption == GameSettings.Options.CHAT_COLOR)
|
|
+ if (settingsOption == Options.CHAT_COLOR)
|
|
{
|
|
this.chatColours = !this.chatColours;
|
|
}
|
|
|
|
- if (settingsOption == GameSettings.Options.CHAT_LINKS)
|
|
+ if (settingsOption == Options.CHAT_LINKS)
|
|
{
|
|
this.chatLinks = !this.chatLinks;
|
|
}
|
|
|
|
- if (settingsOption == GameSettings.Options.CHAT_LINKS_PROMPT)
|
|
+ if (settingsOption == Options.CHAT_LINKS_PROMPT)
|
|
{
|
|
this.chatLinksPrompt = !this.chatLinksPrompt;
|
|
}
|
|
|
|
- if (settingsOption == GameSettings.Options.SNOOPER_ENABLED)
|
|
+ if (settingsOption == Options.SNOOPER_ENABLED)
|
|
{
|
|
this.snooperEnabled = !this.snooperEnabled;
|
|
}
|
|
|
|
- if (settingsOption == GameSettings.Options.TOUCHSCREEN)
|
|
+ if (settingsOption == Options.TOUCHSCREEN)
|
|
{
|
|
this.touchscreen = !this.touchscreen;
|
|
}
|
|
|
|
- if (settingsOption == GameSettings.Options.USE_FULLSCREEN)
|
|
+ if (settingsOption == Options.USE_FULLSCREEN)
|
|
{
|
|
this.fullScreen = !this.fullScreen;
|
|
|
|
@@ -416,49 +418,49 @@
|
|
}
|
|
}
|
|
|
|
- if (settingsOption == GameSettings.Options.ENABLE_VSYNC)
|
|
+ if (settingsOption == Options.ENABLE_VSYNC)
|
|
{
|
|
this.enableVsync = !this.enableVsync;
|
|
Display.setVSyncEnabled(this.enableVsync);
|
|
}
|
|
|
|
- if (settingsOption == GameSettings.Options.USE_VBO)
|
|
+ if (settingsOption == Options.USE_VBO)
|
|
{
|
|
this.useVbo = !this.useVbo;
|
|
this.mc.renderGlobal.loadRenderers();
|
|
}
|
|
|
|
- if (settingsOption == GameSettings.Options.REDUCED_DEBUG_INFO)
|
|
+ if (settingsOption == Options.REDUCED_DEBUG_INFO)
|
|
{
|
|
this.reducedDebugInfo = !this.reducedDebugInfo;
|
|
}
|
|
|
|
- if (settingsOption == GameSettings.Options.ENTITY_SHADOWS)
|
|
+ if (settingsOption == Options.ENTITY_SHADOWS)
|
|
{
|
|
this.entityShadows = !this.entityShadows;
|
|
}
|
|
|
|
- if (settingsOption == GameSettings.Options.ATTACK_INDICATOR)
|
|
+ if (settingsOption == Options.ATTACK_INDICATOR)
|
|
{
|
|
this.attackIndicator = (this.attackIndicator + value) % 3;
|
|
}
|
|
|
|
- if (settingsOption == GameSettings.Options.SHOW_SUBTITLES)
|
|
+ if (settingsOption == Options.SHOW_SUBTITLES)
|
|
{
|
|
this.showSubtitles = !this.showSubtitles;
|
|
}
|
|
|
|
- if (settingsOption == GameSettings.Options.REALMS_NOTIFICATIONS)
|
|
+ if (settingsOption == Options.REALMS_NOTIFICATIONS)
|
|
{
|
|
this.realmsNotifications = !this.realmsNotifications;
|
|
}
|
|
|
|
- if (settingsOption == GameSettings.Options.AUTO_JUMP)
|
|
+ if (settingsOption == Options.AUTO_JUMP)
|
|
{
|
|
this.autoJump = !this.autoJump;
|
|
}
|
|
|
|
- if (settingsOption == GameSettings.Options.NARRATOR)
|
|
+ if (settingsOption == Options.NARRATOR)
|
|
{
|
|
if (NarratorChatListener.INSTANCE.isActive())
|
|
{
|
|
@@ -475,59 +477,59 @@
|
|
this.saveOptions();
|
|
}
|
|
|
|
- public float getOptionFloatValue(GameSettings.Options settingOption)
|
|
+ public float getOptionFloatValue(Options settingOption)
|
|
{
|
|
- if (settingOption == GameSettings.Options.FOV)
|
|
+ if (settingOption == Options.FOV)
|
|
{
|
|
return this.fovSetting;
|
|
}
|
|
- else if (settingOption == GameSettings.Options.GAMMA)
|
|
+ else if (settingOption == Options.GAMMA)
|
|
{
|
|
return this.gammaSetting;
|
|
}
|
|
- else if (settingOption == GameSettings.Options.SATURATION)
|
|
+ else if (settingOption == Options.SATURATION)
|
|
{
|
|
return this.saturation;
|
|
}
|
|
- else if (settingOption == GameSettings.Options.SENSITIVITY)
|
|
+ else if (settingOption == Options.SENSITIVITY)
|
|
{
|
|
return this.mouseSensitivity;
|
|
}
|
|
- else if (settingOption == GameSettings.Options.CHAT_OPACITY)
|
|
+ else if (settingOption == Options.CHAT_OPACITY)
|
|
{
|
|
return this.chatOpacity;
|
|
}
|
|
- else if (settingOption == GameSettings.Options.CHAT_HEIGHT_FOCUSED)
|
|
+ else if (settingOption == Options.CHAT_HEIGHT_FOCUSED)
|
|
{
|
|
return this.chatHeightFocused;
|
|
}
|
|
- else if (settingOption == GameSettings.Options.CHAT_HEIGHT_UNFOCUSED)
|
|
+ else if (settingOption == Options.CHAT_HEIGHT_UNFOCUSED)
|
|
{
|
|
return this.chatHeightUnfocused;
|
|
}
|
|
- else if (settingOption == GameSettings.Options.CHAT_SCALE)
|
|
+ else if (settingOption == Options.CHAT_SCALE)
|
|
{
|
|
return this.chatScale;
|
|
}
|
|
- else if (settingOption == GameSettings.Options.CHAT_WIDTH)
|
|
+ else if (settingOption == Options.CHAT_WIDTH)
|
|
{
|
|
return this.chatWidth;
|
|
}
|
|
- else if (settingOption == GameSettings.Options.FRAMERATE_LIMIT)
|
|
+ else if (settingOption == Options.FRAMERATE_LIMIT)
|
|
{
|
|
return (float)this.limitFramerate;
|
|
}
|
|
- else if (settingOption == GameSettings.Options.MIPMAP_LEVELS)
|
|
+ else if (settingOption == Options.MIPMAP_LEVELS)
|
|
{
|
|
return (float)this.mipmapLevels;
|
|
}
|
|
else
|
|
{
|
|
- return settingOption == GameSettings.Options.RENDER_DISTANCE ? (float)this.renderDistanceChunks : 0.0F;
|
|
+ return settingOption == Options.RENDER_DISTANCE ? (float)this.renderDistanceChunks : 0.0F;
|
|
}
|
|
}
|
|
|
|
- public boolean getOptionOrdinalValue(GameSettings.Options settingOption)
|
|
+ public boolean getOptionOrdinalValue(Options settingOption)
|
|
{
|
|
switch (settingOption)
|
|
{
|
|
@@ -584,7 +586,7 @@
|
|
return I18n.format(strArray[index]);
|
|
}
|
|
|
|
- public String getKeyBinding(GameSettings.Options settingOption)
|
|
+ public String getKeyBinding(Options settingOption)
|
|
{
|
|
String s = I18n.format(settingOption.getTranslation()) + ": ";
|
|
|
|
@@ -593,7 +595,7 @@
|
|
float f1 = this.getOptionFloatValue(settingOption);
|
|
float f = settingOption.normalizeValue(f1);
|
|
|
|
- if (settingOption == GameSettings.Options.SENSITIVITY)
|
|
+ if (settingOption == Options.SENSITIVITY)
|
|
{
|
|
if (f == 0.0F)
|
|
{
|
|
@@ -604,7 +606,7 @@
|
|
return f == 1.0F ? s + I18n.format("options.sensitivity.max") : s + (int)(f * 200.0F) + "%";
|
|
}
|
|
}
|
|
- else if (settingOption == GameSettings.Options.FOV)
|
|
+ else if (settingOption == Options.FOV)
|
|
{
|
|
if (f1 == 70.0F)
|
|
{
|
|
@@ -615,15 +617,15 @@
|
|
return f1 == 110.0F ? s + I18n.format("options.fov.max") : s + (int)f1;
|
|
}
|
|
}
|
|
- else if (settingOption == GameSettings.Options.FRAMERATE_LIMIT)
|
|
+ else if (settingOption == Options.FRAMERATE_LIMIT)
|
|
{
|
|
return f1 == settingOption.valueMax ? s + I18n.format("options.framerateLimit.max") : s + I18n.format("options.framerate", (int)f1);
|
|
}
|
|
- else if (settingOption == GameSettings.Options.RENDER_CLOUDS)
|
|
+ else if (settingOption == Options.RENDER_CLOUDS)
|
|
{
|
|
return f1 == settingOption.valueMin ? s + I18n.format("options.cloudHeight.min") : s + ((int)f1 + 128);
|
|
}
|
|
- else if (settingOption == GameSettings.Options.GAMMA)
|
|
+ else if (settingOption == Options.GAMMA)
|
|
{
|
|
if (f == 0.0F)
|
|
{
|
|
@@ -634,31 +636,31 @@
|
|
return f == 1.0F ? s + I18n.format("options.gamma.max") : s + "+" + (int)(f * 100.0F) + "%";
|
|
}
|
|
}
|
|
- else if (settingOption == GameSettings.Options.SATURATION)
|
|
+ else if (settingOption == Options.SATURATION)
|
|
{
|
|
return s + (int)(f * 400.0F) + "%";
|
|
}
|
|
- else if (settingOption == GameSettings.Options.CHAT_OPACITY)
|
|
+ else if (settingOption == Options.CHAT_OPACITY)
|
|
{
|
|
return s + (int)(f * 90.0F + 10.0F) + "%";
|
|
}
|
|
- else if (settingOption == GameSettings.Options.CHAT_HEIGHT_UNFOCUSED)
|
|
+ else if (settingOption == Options.CHAT_HEIGHT_UNFOCUSED)
|
|
{
|
|
return s + GuiNewChat.calculateChatboxHeight(f) + "px";
|
|
}
|
|
- else if (settingOption == GameSettings.Options.CHAT_HEIGHT_FOCUSED)
|
|
+ else if (settingOption == Options.CHAT_HEIGHT_FOCUSED)
|
|
{
|
|
return s + GuiNewChat.calculateChatboxHeight(f) + "px";
|
|
}
|
|
- else if (settingOption == GameSettings.Options.CHAT_WIDTH)
|
|
+ else if (settingOption == Options.CHAT_WIDTH)
|
|
{
|
|
return s + GuiNewChat.calculateChatboxWidth(f) + "px";
|
|
}
|
|
- else if (settingOption == GameSettings.Options.RENDER_DISTANCE)
|
|
+ else if (settingOption == Options.RENDER_DISTANCE)
|
|
{
|
|
return s + I18n.format("options.chunks", (int)f1);
|
|
}
|
|
- else if (settingOption == GameSettings.Options.MIPMAP_LEVELS)
|
|
+ else if (settingOption == Options.MIPMAP_LEVELS)
|
|
{
|
|
return f1 == 0.0F ? s + I18n.format("options.off") : s + (int)f1;
|
|
}
|
|
@@ -672,31 +674,31 @@
|
|
boolean flag = this.getOptionOrdinalValue(settingOption);
|
|
return flag ? s + I18n.format("options.on") : s + I18n.format("options.off");
|
|
}
|
|
- else if (settingOption == GameSettings.Options.MAIN_HAND)
|
|
+ else if (settingOption == Options.MAIN_HAND)
|
|
{
|
|
return s + this.mainHand;
|
|
}
|
|
- else if (settingOption == GameSettings.Options.GUI_SCALE)
|
|
+ else if (settingOption == Options.GUI_SCALE)
|
|
{
|
|
return s + getTranslation(GUISCALES, this.guiScale);
|
|
}
|
|
- else if (settingOption == GameSettings.Options.CHAT_VISIBILITY)
|
|
+ else if (settingOption == Options.CHAT_VISIBILITY)
|
|
{
|
|
return s + I18n.format(this.chatVisibility.getResourceKey());
|
|
}
|
|
- else if (settingOption == GameSettings.Options.PARTICLES)
|
|
+ else if (settingOption == Options.PARTICLES)
|
|
{
|
|
return s + getTranslation(PARTICLES, this.particleSetting);
|
|
}
|
|
- else if (settingOption == GameSettings.Options.AMBIENT_OCCLUSION)
|
|
+ else if (settingOption == Options.AMBIENT_OCCLUSION)
|
|
{
|
|
return s + getTranslation(AMBIENT_OCCLUSIONS, this.ambientOcclusion);
|
|
}
|
|
- else if (settingOption == GameSettings.Options.RENDER_CLOUDS)
|
|
+ else if (settingOption == Options.RENDER_CLOUDS)
|
|
{
|
|
return s + getTranslation(CLOUDS_TYPES, this.clouds);
|
|
}
|
|
- else if (settingOption == GameSettings.Options.GRAPHICS)
|
|
+ else if (settingOption == Options.GRAPHICS)
|
|
{
|
|
if (this.fancyGraphics)
|
|
{
|
|
@@ -708,11 +710,11 @@
|
|
return s + I18n.format("options.graphics.fast");
|
|
}
|
|
}
|
|
- else if (settingOption == GameSettings.Options.ATTACK_INDICATOR)
|
|
+ else if (settingOption == Options.ATTACK_INDICATOR)
|
|
{
|
|
return s + getTranslation(ATTACK_INDICATORS, this.attackIndicator);
|
|
}
|
|
- else if (settingOption == GameSettings.Options.NARRATOR)
|
|
+ else if (settingOption == Options.NARRATOR)
|
|
{
|
|
return NarratorChatListener.INSTANCE.isActive() ? s + getTranslation(NARRATOR_MODES, this.narrator) : s + I18n.format("options.narrator.notavailable");
|
|
}
|
|
@@ -1068,7 +1070,12 @@
|
|
{
|
|
if (s1.equals("key_" + keybinding.getKeyDescription()))
|
|
{
|
|
- keybinding.setKeyCode(Integer.parseInt(s2));
|
|
+ if (s2.indexOf(':') != -1)
|
|
+ {
|
|
+ String[] t = s2.split(":");
|
|
+ keybinding.setKeyModifierAndCode(net.minecraftforge.client.settings.KeyModifier.valueFromString(t[1]), Integer.parseInt(t[0]));
|
|
+ } else
|
|
+ keybinding.setKeyModifierAndCode(net.minecraftforge.client.settings.KeyModifier.NONE, Integer.parseInt(s2));
|
|
}
|
|
}
|
|
|
|
@@ -1132,6 +1139,7 @@
|
|
|
|
public void saveOptions()
|
|
{
|
|
+ if (net.minecraftforge.fml.client.FMLClientHandler.instance().isLoading()) return;
|
|
PrintWriter printwriter = null;
|
|
|
|
try
|
|
@@ -1206,7 +1214,8 @@
|
|
|
|
for (KeyBinding keybinding : this.keyBindings)
|
|
{
|
|
- printwriter.println("key_" + keybinding.getKeyDescription() + ":" + keybinding.getKeyCode());
|
|
+ String keyString = "key_" + keybinding.getKeyDescription() + ":" + keybinding.getKeyCode();
|
|
+ printwriter.println(keybinding.getKeyModifier() != net.minecraftforge.client.settings.KeyModifier.NONE ? keyString + ":" + keybinding.getKeyModifier() : keyString);
|
|
}
|
|
|
|
for (SoundCategory soundcategory : SoundCategory.values())
|
|
@@ -1351,9 +1360,9 @@
|
|
private float valueMin;
|
|
private float valueMax;
|
|
|
|
- public static GameSettings.Options byOrdinal(int ordinal)
|
|
+ public static Options byOrdinal(int ordinal)
|
|
{
|
|
- for (GameSettings.Options gamesettings$options : values())
|
|
+ for (Options gamesettings$options : values())
|
|
{
|
|
if (gamesettings$options.getOrdinal() == ordinal)
|
|
{
|
|
@@ -1440,4 +1449,35 @@
|
|
return value;
|
|
}
|
|
}
|
|
+
|
|
+ /******* Forge Start ***********/
|
|
+ private void setForgeKeybindProperties() {
|
|
+ net.minecraftforge.client.settings.KeyConflictContext inGame = net.minecraftforge.client.settings.KeyConflictContext.IN_GAME;
|
|
+ keyBindForward.setKeyConflictContext(inGame);
|
|
+ keyBindLeft.setKeyConflictContext(inGame);
|
|
+ keyBindBack.setKeyConflictContext(inGame);
|
|
+ keyBindRight.setKeyConflictContext(inGame);
|
|
+ keyBindJump.setKeyConflictContext(inGame);
|
|
+ keyBindSneak.setKeyConflictContext(inGame);
|
|
+ keyBindSprint.setKeyConflictContext(inGame);
|
|
+ keyBindAttack.setKeyConflictContext(inGame);
|
|
+ keyBindChat.setKeyConflictContext(inGame);
|
|
+ keyBindPlayerList.setKeyConflictContext(inGame);
|
|
+ keyBindCommand.setKeyConflictContext(inGame);
|
|
+ keyBindTogglePerspective.setKeyConflictContext(inGame);
|
|
+ keyBindSmoothCamera.setKeyConflictContext(inGame);
|
|
+ keyBindSwapHands.setKeyConflictContext(inGame);
|
|
+ }
|
|
+
|
|
+ // FORGE: fix for MC-64581 very laggy mipmap slider
|
|
+ private boolean needsResourceRefresh = false;
|
|
+ public void onGuiClosed()
|
|
+ {
|
|
+ if (needsResourceRefresh)
|
|
+ {
|
|
+ this.mc.scheduleResourcesRefresh();
|
|
+ this.needsResourceRefresh = false;
|
|
+ }
|
|
+ }
|
|
+ /******* Forge End ***********/
|
|
}
|