diff options
| author | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2021-12-28 00:49:28 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-12-28 16:49:28 +1100 |
| commit | ea3ec354ba3bb5b4ac64b8032816b8e4c407f099 (patch) | |
| tree | 2a1b35a90a5b2e430ed8b09cfb0c6c8e28166039 /src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/FairySouls.java | |
| parent | 0aa264dd9df3205cf9641f052b6622fd36b811d5 (diff) | |
| download | notenoughupdates-ea3ec354ba3bb5b4ac64b8032816b8e4c407f099.tar.gz notenoughupdates-ea3ec354ba3bb5b4ac64b8032816b8e4c407f099.tar.bz2 notenoughupdates-ea3ec354ba3bb5b4ac64b8032816b8e4c407f099.zip | |
more code clean up (#38)
Diffstat (limited to 'src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/FairySouls.java')
| -rw-r--r-- | src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/FairySouls.java | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/FairySouls.java b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/FairySouls.java index 8d611845..9e219852 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/FairySouls.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/FairySouls.java @@ -27,7 +27,6 @@ import java.util.*; import java.util.stream.Collectors; public class FairySouls { - private static final String unknownProfile = "unknown"; private static List<BlockPos> currentSoulList = null; private static List<BlockPos> currentSoulListClose = null; @@ -147,15 +146,13 @@ public class FairySouls { try { //noinspection UnstableApiUsage - Type multiProfileSoulsType = new TypeToken<HashMap<String, HashMap<String, Set<Integer>>>>() { - }.getType(); + Type multiProfileSoulsType = new TypeToken<HashMap<String, HashMap<String, Set<Integer>>>>() {}.getType(); loadedFoundSouls = gson.fromJson(fileContent, multiProfileSoulsType); } catch (JsonSyntaxException e) { //The file is in the old format, convert it to the new one and set the profile to unknown try { //noinspection UnstableApiUsage - Type singleProfileSoulsType = new TypeToken<HashMap<String, Set<Integer>>>() { - }.getType(); + Type singleProfileSoulsType = new TypeToken<HashMap<String, Set<Integer>>>() {}.getType(); loadedFoundSouls.put(unknownProfile, gson.fromJson(fileContent, singleProfileSoulsType)); } catch (JsonSyntaxException e2) { System.err.println("Can't read file containing collected fairy souls, resetting."); @@ -171,8 +168,7 @@ public class FairySouls { try (BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(file), StandardCharsets.UTF_8))) { writer.write(gson.toJson(loadedFoundSouls)); } - } catch (IOException ignored) { - } + } catch (IOException ignored) {} } public static void tick() { @@ -212,8 +208,7 @@ public class FairySouls { currentSoulList.add(new BlockPos(x, y, z)); } - } catch (Exception ignored) { - } + } catch (Exception ignored) {} } } } @@ -322,5 +317,4 @@ public class FairySouls { super("neusouls", fairysoulRunnable); } } - } |
