diff --git a/src/main/java/codechicken/nei/LayoutManager.java b/src/main/java/codechicken/nei/LayoutManager.java index eda28cb62..f0950b1bc 100644 --- a/src/main/java/codechicken/nei/LayoutManager.java +++ b/src/main/java/codechicken/nei/LayoutManager.java @@ -406,7 +406,8 @@ private boolean getIsAccessibleControlEventKey() { @Override public boolean onButtonPress(boolean rightclick) { if (!rightclick) { - if (Keyboard.getEventKeyState() && getIsAccessibleControlEventKey()) { + if (Keyboard.getEventKeyState() && getIsAccessibleControlEventKey() + && NEIClientConfig.canChangeCheatMode()) { NEIClientConfig.cycleSetting("inventory.cheatmode", 3); } else { if (Keyboard.getEventKeyState() && (Keyboard.getEventKey() == Keyboard.KEY_LSHIFT @@ -430,7 +431,10 @@ public void addTooltips(List tooltip) { else if (cheatMode == 2) modeColor = EnumChatFormatting.RED.toString(); String controlKeyLocalization = translate(Minecraft.isRunningOnMac ? "key.ctrl.mac" : "key.ctrl"); tooltip.add(modeColor + translate("inventory.options.tip.cheatmode." + cheatMode)); - tooltip.add(modeColor + translate("inventory.options.tip.cheatmode.disable", controlKeyLocalization)); + if (NEIClientConfig.canChangeCheatMode()) { + tooltip.add( + modeColor + translate("inventory.options.tip.cheatmode.disable", controlKeyLocalization)); + } } @Override diff --git a/src/main/java/codechicken/nei/NEIClientConfig.java b/src/main/java/codechicken/nei/NEIClientConfig.java index afcc93bb6..734141ab6 100644 --- a/src/main/java/codechicken/nei/NEIClientConfig.java +++ b/src/main/java/codechicken/nei/NEIClientConfig.java @@ -157,7 +157,7 @@ public boolean optionValid(int index) { return getLockedMode() == -1 || getLockedMode() == index && NEIInfo.isValidMode(index); } }); - checkCheatMode(); + canChangeCheatMode(); tag.getTag("inventory.utilities").setDefaultValue("delete, magnet"); API.addOption(new OptionUtilities("inventory.utilities")); @@ -808,8 +808,13 @@ public static int getCheatMode() { return getIntSetting("inventory.cheatmode"); } - private static void checkCheatMode() { - if (getLockedMode() != -1) setIntSetting("inventory.cheatmode", getLockedMode()); + public static boolean canChangeCheatMode() { + if (getLockedMode() != -1) { + setIntSetting("inventory.cheatmode", getLockedMode()); + return false; + } + + return true; } public static int getLockedMode() {