From 621e97c9973a814a2f9735706b6d6688649b0da7 Mon Sep 17 00:00:00 2001 From: orifu Date: Wed, 5 Jun 2024 01:40:28 +0100 Subject: [PATCH] use that classic intellij format style --- .../rainglow/config/CustomModeScreen.java | 18 +++--- .../rainglow/config/RainglowConfigScreen.java | 62 +++++++++---------- .../config/SaveableGameOptionsScreen.java | 19 +++--- 3 files changed, 50 insertions(+), 49 deletions(-) diff --git a/src/main/java/io/ix0rai/rainglow/config/CustomModeScreen.java b/src/main/java/io/ix0rai/rainglow/config/CustomModeScreen.java index 2d5ad20..3aea6df 100644 --- a/src/main/java/io/ix0rai/rainglow/config/CustomModeScreen.java +++ b/src/main/java/io/ix0rai/rainglow/config/CustomModeScreen.java @@ -43,15 +43,15 @@ protected void save() { protected void method_60325() { for (RainglowColour colour : RainglowColour.values()) { this.options.add(DeferredSaveOption.createDeferredBoolean( - "colour." + colour.getId(), - null, - Rainglow.CONFIG.customColours.getRealValue().contains(colour.getId()), - enabled -> { - if (enabled) { - Rainglow.CONFIG.customColours.getRealValue().add(colour.getId()); - } - }, - enabled -> this.saveButton.active = true + "colour." + colour.getId(), + null, + Rainglow.CONFIG.customColours.getRealValue().contains(colour.getId()), + enabled -> { + if (enabled) { + Rainglow.CONFIG.customColours.getRealValue().add(colour.getId()); + } + }, + enabled -> this.saveButton.active = true )); } diff --git a/src/main/java/io/ix0rai/rainglow/config/RainglowConfigScreen.java b/src/main/java/io/ix0rai/rainglow/config/RainglowConfigScreen.java index ae30e3b..e1106fd 100644 --- a/src/main/java/io/ix0rai/rainglow/config/RainglowConfigScreen.java +++ b/src/main/java/io/ix0rai/rainglow/config/RainglowConfigScreen.java @@ -87,52 +87,52 @@ protected void method_60325() { contentLayout.add(gridWidget); contentLayout.add(ButtonWidget.builder( - Rainglow.translatableText("config.custom"), - button -> MinecraftClient.getInstance().setScreen(new CustomModeScreen(this)) - ).width(308).position(4, 0).build(), - LayoutSettings.create().setPadding(4, 0)); + Rainglow.translatableText("config.custom"), + button -> MinecraftClient.getInstance().setScreen(new CustomModeScreen(this)) + ).width(308).position(4, 0).build(), + LayoutSettings.create().setPadding(4, 0)); this.field_49503.addToContents(contentLayout); } private DeferredSaveOption createEntityToggle(RainglowEntity entity) { return DeferredSaveOption.createDeferredBoolean( - "config.enable_" + entity.getId(), - "tooltip.entity_toggle", - Rainglow.CONFIG.toggles.getRealValue().get(entity.getId()), - enabled -> Rainglow.CONFIG.toggles.getRealValue().put(entity.getId(), enabled), - enabled -> this.saveButton.active = true + "config.enable_" + entity.getId(), + "tooltip.entity_toggle", + Rainglow.CONFIG.toggles.getRealValue().get(entity.getId()), + enabled -> Rainglow.CONFIG.toggles.getRealValue().put(entity.getId(), enabled), + enabled -> this.saveButton.active = true ); } private DeferredSaveOption createColourRaritySlider(RainglowEntity entity) { return DeferredSaveOption.createDeferredRangedInt( - "config." + entity.getId() + "_rarity", - "tooltip.rarity", - Rainglow.CONFIG.rarities.getRealValue().get(entity.getId()), - 0, - 100, - rarity -> Rainglow.CONFIG.rarities.getRealValue().put(entity.getId(), rarity), - rarity -> this.saveButton.active = true - ); + "config." + entity.getId() + "_rarity", + "tooltip.rarity", + Rainglow.CONFIG.rarities.getRealValue().get(entity.getId()), + 0, + 100, + rarity -> Rainglow.CONFIG.rarities.getRealValue().put(entity.getId(), rarity), + rarity -> this.saveButton.active = true + ); } public CyclingButtonWidget createModeButton() { return CyclingButtonWidget.builder(RainglowMode::getText) - .values(RainglowMode.values()) - .initially(this.mode) - .tooltip(this::createColourListLabel) - .build( - 0, - 0, - 308, - 20, - Rainglow.translatableText("config.mode"), - (cyclingButtonWidget, mode) -> { - this.saveButton.active = true; - this.mode = mode; - } - ); + .values(RainglowMode.values()) + .initially(this.mode) + .tooltip(this::createColourListLabel) + .build( + 0, + 0, + 308, + 20, + Rainglow.translatableText("config.mode"), + (cyclingButtonWidget, mode) -> { + this.saveButton.active = true; + this.mode = mode; + } + ); } private Tooltip createColourListLabel(RainglowMode mode) { diff --git a/src/main/java/io/ix0rai/rainglow/config/SaveableGameOptionsScreen.java b/src/main/java/io/ix0rai/rainglow/config/SaveableGameOptionsScreen.java index d045ec2..1e63431 100644 --- a/src/main/java/io/ix0rai/rainglow/config/SaveableGameOptionsScreen.java +++ b/src/main/java/io/ix0rai/rainglow/config/SaveableGameOptionsScreen.java @@ -23,12 +23,12 @@ public SaveableGameOptionsScreen(Screen parent, Text title) { super(parent, MinecraftClient.getInstance().options, title); this.saveButton = ButtonWidget.builder( - Rainglow.translatableText("config.save"), - button -> { - if (this.validate()) { - this.save(); - } - }).build(); + Rainglow.translatableText("config.save"), + button -> { + if (this.validate()) { + this.save(); + } + }).build(); this.saveButton.active = false; } @@ -74,9 +74,10 @@ protected void init() { contentWidget.add(new TextWidget(Rainglow.translatableText("config.unsaved_warning"), this.textRenderer), LayoutSettings::alignHorizontallyCenter); LinearLayoutWidget buttons = new LinearLayoutWidget(250, 20, LinearLayoutWidget.Orientation.HORIZONTAL).setSpacing(8); - buttons.add(ButtonWidget.builder(Rainglow.translatableText("config.continue_editing"), (buttonWidget) -> { - MinecraftClient.getInstance().setScreen(SaveableGameOptionsScreen.this); - }).build()); + buttons.add(ButtonWidget.builder( + Rainglow.translatableText("config.continue_editing"), + (buttonWidget) -> MinecraftClient.getInstance().setScreen(SaveableGameOptionsScreen.this) + ).build()); buttons.add(ButtonWidget.builder(CommonTexts.YES, (buttonWidget) -> MinecraftClient.getInstance().setScreen(parent)).build()); contentWidget.add(buttons, LayoutSettings::alignHorizontallyCenter);