aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at
diff options
context:
space:
mode:
authorhannibal00212 <hannibal00212@users.noreply.github.com>2022-07-08 14:14:06 +0000
committerGitHub Action <actions@github.com>2022-07-08 14:14:06 +0000
commit3bd7c17ca84115c3f47c3cea010169e3b596a63c (patch)
tree58618c641aed5ea5da4264ccd8cc6b523cf958e4 /src/main/java/at
parent5fd347181e3ab2a6e9c02413d2363b8e6a3243ee (diff)
downloadskyhanni-3bd7c17ca84115c3f47c3cea010169e3b596a63c.tar.gz
skyhanni-3bd7c17ca84115c3f47c3cea010169e3b596a63c.tar.bz2
skyhanni-3bd7c17ca84115c3f47c3cea010169e3b596a63c.zip
Prettified Code!
Diffstat (limited to 'src/main/java/at')
-rw-r--r--src/main/java/at/lorenz/mod/LorenzMod.java18
-rw-r--r--src/main/java/at/lorenz/mod/config/Features.java4
2 files changed, 9 insertions, 13 deletions
diff --git a/src/main/java/at/lorenz/mod/LorenzMod.java b/src/main/java/at/lorenz/mod/LorenzMod.java
index e1ceea004..ef5a2479e 100644
--- a/src/main/java/at/lorenz/mod/LorenzMod.java
+++ b/src/main/java/at/lorenz/mod/LorenzMod.java
@@ -11,6 +11,8 @@ import at.lorenz.mod.dungeon.DungeonHighlightClickedBlocks;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.thatgravyboat.skyblockhud_2.commands.Commands;
+import java.io.*;
+import java.nio.charset.StandardCharsets;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiScreen;
import net.minecraftforge.common.MinecraftForge;
@@ -20,16 +22,13 @@ import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.fml.common.gameevent.TickEvent;
-import java.io.*;
-import java.nio.charset.StandardCharsets;
-
@Mod(modid = LorenzMod.MODID, version = LorenzMod.VERSION)
public class LorenzMod {
public static final String MODID = "lorenzmod";
public static final String VERSION = "0.2.1";
-// public static SBHConfig config; //TODO delete
+ // public static SBHConfig config; //TODO delete
public static Features feature;
private File configFile;
@@ -83,22 +82,20 @@ public class LorenzMod {
//
// ((IReloadableResourceManager) Minecraft.getMinecraft().getResourceManager()).registerReloadListener(new NpcDialogue());
-// ((IReloadableResourceManager) Minecraft.getMinecraft().getResourceManager()).registerReloadListener(new Textures());
+ // ((IReloadableResourceManager) Minecraft.getMinecraft().getResourceManager()).registerReloadListener(new Textures());
//
configDirectory = new File("mods/LorenzMod/config");
try {
//noinspection ResultOfMethodCallIgnored
configDirectory.mkdir();
- } catch (Exception ignored) {
- }
+ } catch (Exception ignored) {}
configFile = new File(configDirectory, "config.json");
if (configFile.exists()) {
try (BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream(configFile), StandardCharsets.UTF_8))) {
feature = gson.fromJson(reader, Features.class);
- } catch (Exception ignored) {
- }
+ } catch (Exception ignored) {}
}
if (feature == null) {
@@ -124,8 +121,7 @@ public class LorenzMod {
try (BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(configFile), StandardCharsets.UTF_8))) {
writer.write(gson.toJson(feature));
}
- } catch (IOException ignored) {
- }
+ } catch (IOException ignored) {}
}
// @EventHandler
diff --git a/src/main/java/at/lorenz/mod/config/Features.java b/src/main/java/at/lorenz/mod/config/Features.java
index f441a2db7..bfd48f627 100644
--- a/src/main/java/at/lorenz/mod/config/Features.java
+++ b/src/main/java/at/lorenz/mod/config/Features.java
@@ -1,7 +1,7 @@
package at.lorenz.mod.config;
-import com.google.gson.annotations.Expose;
import at.lorenz.mod.LorenzMod;
+import com.google.gson.annotations.Expose;
import com.thatgravyboat.skyblockhud_2.config.SBHConfigEditor;
import com.thatgravyboat.skyblockhud_2.core.GuiScreenElementWrapper;
import com.thatgravyboat.skyblockhud_2.core.config.Position;
@@ -11,7 +11,7 @@ import com.thatgravyboat.skyblockhud_2.core.config.annotations.ConfigOption;
import com.thatgravyboat.skyblockhud_2.core.config.gui.GuiPositionEditor;
import net.minecraft.client.Minecraft;
-public class Features {
+public class Features {
private void editOverlay(String activeConfig, int width, int height, Position position) {
Minecraft.getMinecraft().displayGuiScreen(new GuiPositionEditor(position, width, height, () -> {}, () -> {}, () -> LorenzMod.screenToOpen = new GuiScreenElementWrapper(new SBHConfigEditor(LorenzMod.feature, activeConfig))));