Skip to content

Commit

Permalink
Fix #598 Cheat keybind not updating GUI config
Browse files Browse the repository at this point in the history
  • Loading branch information
mezz committed Nov 11, 2016
1 parent fb4f3ca commit f6f354e
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/main/java/mezz/jei/config/Config.java
Expand Up @@ -110,9 +110,17 @@ public static void toggleCheatItemsEnabled() {
public static void setCheatItemsEnabled(boolean value) {
if (cheatItemsEnabled != value) {
cheatItemsEnabled = value;

if (worldConfig != null) {
worldConfig.save();
final String worldCategory = SessionData.getWorldUid();
Property property = worldConfig.get(worldCategory, "cheatItemsEnabled", cheatItemsEnabled);
property.set(cheatItemsEnabled);

if (worldConfig.hasChanged()) {
worldConfig.save();
}
}

if (cheatItemsEnabled && SessionData.isJeiOnServer()) {
JustEnoughItems.getProxy().sendPacketToServer(new PacketRequestCheatPermission());
}
Expand Down

0 comments on commit f6f354e

Please sign in to comment.