diff --git a/src/main/java/io/ix0rai/rainglow/config/CustomModeScreen.java b/src/main/java/io/ix0rai/rainglow/config/CustomModeScreen.java index 0f14d9a..d0d112d 100644 --- a/src/main/java/io/ix0rai/rainglow/config/CustomModeScreen.java +++ b/src/main/java/io/ix0rai/rainglow/config/CustomModeScreen.java @@ -53,10 +53,10 @@ private void createColourToggles() { this.options.add(DeferredSaveOption.createDeferredBoolean( "colour." + colour.getId(), null, - Rainglow.CONFIG.getCustom().contains(colour), + Rainglow.CONFIG.customColours.getRealValue().contains(colour.getId()), enabled -> { if (enabled) { - Rainglow.CONFIG.customColours.value().add(colour.getId()); + Rainglow.CONFIG.customColours.getRealValue().add(colour.getId()); } }, enabled -> this.saveButton.active = true @@ -65,7 +65,7 @@ private void createColourToggles() { } private void save() { - Rainglow.CONFIG.customColours.value().clear(); + Rainglow.CONFIG.customColours.getRealValue().clear(); for (DeferredSaveOption option : this.options) { option.save(); diff --git a/src/main/java/io/ix0rai/rainglow/config/RainglowConfigScreen.java b/src/main/java/io/ix0rai/rainglow/config/RainglowConfigScreen.java index 9a5273a..5aa8b97 100644 --- a/src/main/java/io/ix0rai/rainglow/config/RainglowConfigScreen.java +++ b/src/main/java/io/ix0rai/rainglow/config/RainglowConfigScreen.java @@ -42,7 +42,7 @@ public class RainglowConfigScreen extends Screen { public RainglowConfigScreen(@Nullable Screen parent) { super(TITLE); this.parent = parent; - this.mode = RainglowMode.get(Rainglow.CONFIG.mode.value()); + this.mode = RainglowMode.get(Rainglow.CONFIG.mode.getRealValue()); this.saveButton = ButtonWidget.builder(Rainglow.translatableText("config.save"), button -> { this.save(); this.closeScreen(true); @@ -109,7 +109,7 @@ private DeferredSaveOption createEntityToggle(RainglowEntity entity) { return toggles.computeIfAbsent(entity, e -> DeferredSaveOption.createDeferredBoolean( "config.enable_" + e.getId(), "tooltip.entity_toggle", - Rainglow.CONFIG.isEntityEnabled(e), + Rainglow.CONFIG.toggles.getRealValue().get(e.getId()), enabled -> Rainglow.CONFIG.setEntityEnabled(e, enabled), enabled -> this.saveButton.active = true )); @@ -119,7 +119,7 @@ private DeferredSaveOption createColourRaritySlider(RainglowEntity enti return sliders.computeIfAbsent(entity, e -> DeferredSaveOption.createDeferredRangedInt( "config." + e.getId() + "_rarity", "tooltip.rarity", - Rainglow.CONFIG.getRarity(e), + Rainglow.CONFIG.rarities.getRealValue().get(e.getId()), 0, 100, rarity -> Rainglow.CONFIG.setRarity(e, rarity), @@ -156,6 +156,7 @@ private void save() { } Rainglow.CONFIG.mode.setValue(this.mode.getId()); + Rainglow.setMode(RainglowMode.get(this.mode.getId())); } private Tooltip createColourListLabel(RainglowMode mode) {