New worlds ignoring global cheatmode (#1003)

Co-authored-by: slprime <[email protected]>
This commit is contained in:
Taran Robertsandslprime authored and GitHub committed 2026-08-14 16:20:31 +03:00
1 parent f93d5977ed
commit 75d53b12ca
2 files changed
+10 -4

No files matched your search

@@ -882,9 +882,14 @@ public class NEIClientConfig {
world = new ConfigSet(new File(specificDir, "NEI.dat"), new ConfigFile(new File(specificDir, "NEI.cfg")));
if (newWorld && Minecraft.getMinecraft().isSingleplayer()) {
world.config.getTag("inventory.cheatmode")
.setIntValue(NEIClientUtils.mc().playerController.isInCreativeMode() ? 2 : 0);
if (newWorld && Minecraft.getMinecraft().isSingleplayer() && getLockedMode() == -1) {
final int globalMode = global.config.getTag("inventory.cheatmode").getIntValue();
final int worldMode = Math
.min(globalMode, NEIClientUtils.mc().playerController.isInCreativeMode() ? 2 : 0);
if (worldMode != globalMode) {
world.config.getTag("inventory.cheatmode").setIntValue(worldMode);
}
}
bootNEI();