From a4ef13092307ae03eb940c6ab819849af03b1c8b Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 23 May 2023 23:38:49 +0000 Subject: [PATCH] Format code [skip actions] --- .../java/emu/grasscutter/tools/Dumpers.java | 29 +++++++------------ .../grasscutter/utils/StartupArguments.java | 7 ++--- 2 files changed, 14 insertions(+), 22 deletions(-) diff --git a/src/main/java/emu/grasscutter/tools/Dumpers.java b/src/main/java/emu/grasscutter/tools/Dumpers.java index b2e4a04a8..8420d9914 100644 --- a/src/main/java/emu/grasscutter/tools/Dumpers.java +++ b/src/main/java/emu/grasscutter/tools/Dumpers.java @@ -9,8 +9,6 @@ import emu.grasscutter.game.inventory.ItemType; import emu.grasscutter.game.props.SceneType; import emu.grasscutter.utils.JsonUtils; import emu.grasscutter.utils.lang.Language; -import lombok.AllArgsConstructor; - import java.io.File; import java.io.IOException; import java.nio.file.Files; @@ -19,6 +17,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.stream.Collectors; +import lombok.AllArgsConstructor; public interface Dumpers { // See `src/handbook/data/README.md` for attributions. @@ -351,20 +350,15 @@ public interface Dumpers { // Convert all known areas to an area map. var dump = new HashMap(); GameData.getWorldAreaDataMap() - .forEach( - (id, area) -> { - var langHash = area.getTextMapHash(); - dump.put( - area.getChildArea() == 0 ? - area.getParentArea() : - area.getChildArea(), - new AreaInfo( - area.getParentArea(), - langHash == 0 - ? "Unknown" - : Language.getTextMapKey(langHash).get(locale) - )); - }); + .forEach( + (id, area) -> { + var langHash = area.getTextMapHash(); + dump.put( + area.getChildArea() == 0 ? area.getParentArea() : area.getChildArea(), + new AreaInfo( + area.getParentArea(), + langHash == 0 ? "Unknown" : Language.getTextMapKey(langHash).get(locale))); + }); try { // Create a file for the dump. @@ -374,8 +368,7 @@ public interface Dumpers { throw new RuntimeException("Failed to create file."); // Write the dump to the file. - Files.writeString(file.toPath(), Dumpers.miniEncode(dump, - "id", "parent", "name")); + Files.writeString(file.toPath(), Dumpers.miniEncode(dump, "id", "parent", "name")); } catch (IOException ignored) { throw new RuntimeException("Failed to write to file."); } diff --git a/src/main/java/emu/grasscutter/utils/StartupArguments.java b/src/main/java/emu/grasscutter/utils/StartupArguments.java index f2d09fa4f..e8dc58aa9 100644 --- a/src/main/java/emu/grasscutter/utils/StartupArguments.java +++ b/src/main/java/emu/grasscutter/utils/StartupArguments.java @@ -1,18 +1,17 @@ package emu.grasscutter.utils; +import static emu.grasscutter.config.Configuration.*; + import ch.qos.logback.classic.Level; import ch.qos.logback.classic.Logger; import emu.grasscutter.BuildConfig; import emu.grasscutter.Grasscutter; import emu.grasscutter.net.packet.PacketOpcodesUtils; import emu.grasscutter.tools.Dumpers; -import org.slf4j.LoggerFactory; - import java.util.HashMap; import java.util.Map; import java.util.function.Function; - -import static emu.grasscutter.config.Configuration.*; +import org.slf4j.LoggerFactory; /** A parser for start-up arguments. */ public interface StartupArguments {