aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni
diff options
context:
space:
mode:
authorLorenz <ESs95s3P5z8Pheb>2022-07-15 19:41:48 +0200
committerLorenz <ESs95s3P5z8Pheb>2022-07-15 19:42:31 +0200
commit81dba6a4a1fd014984ec5a24d4310a3a414fa316 (patch)
tree25d0ba866c0308e7f7afd052884c6ca0f9816201 /src/main/java/at/hannibal2/skyhanni
parente86e483b0a0603dd488dadc96f4428b4993a205e (diff)
parenta85403cfd16da0134fbe6fb31a37761657e1119a (diff)
downloadskyhanni-81dba6a4a1fd014984ec5a24d4310a3a414fa316.tar.gz
skyhanni-81dba6a4a1fd014984ec5a24d4310a3a414fa316.tar.bz2
skyhanni-81dba6a4a1fd014984ec5a24d4310a3a414fa316.zip
Merge remote-tracking branch 'origin/master'
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/SkyHanniMod.java14
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/Features.java5
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/commands/Commands.java30
3 files changed, 29 insertions, 20 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.java b/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.java
index be6cbe41e..216a5611e 100644
--- a/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.java
+++ b/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.java
@@ -19,6 +19,8 @@ import at.hannibal2.skyhanni.repo.RepoManager;
import at.hannibal2.skyhanni.test.LorenzTest;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
+import java.io.*;
+import java.nio.charset.StandardCharsets;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiScreen;
import net.minecraftforge.common.MinecraftForge;
@@ -28,9 +30,6 @@ 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 = SkyHanniMod.MODID, version = SkyHanniMod.VERSION)
public class SkyHanniMod {
@@ -82,14 +81,16 @@ public class SkyHanniMod {
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) {
@@ -110,7 +111,8 @@ public class SkyHanniMod {
try (BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(configFile), StandardCharsets.UTF_8))) {
writer.write(gson.toJson(feature));
}
- } catch (IOException ignored) {}
+ } catch (IOException ignored) {
+ }
}
public static GuiScreen screenToOpen = null;
diff --git a/src/main/java/at/hannibal2/skyhanni/config/Features.java b/src/main/java/at/hannibal2/skyhanni/config/Features.java
index 4120d6581..9ddcb3250 100644
--- a/src/main/java/at/hannibal2/skyhanni/config/Features.java
+++ b/src/main/java/at/hannibal2/skyhanni/config/Features.java
@@ -13,9 +13,7 @@ import net.minecraft.client.Minecraft;
public class Features {
private void editOverlay(String activeConfig, int width, int height, Position position) {
- Minecraft.getMinecraft().displayGuiScreen(new GuiPositionEditor(position, width, height, () -> {
- }, () -> {
- }, () -> SkyHanniMod.screenToOpen = new GuiScreenElementWrapper(new ConfigEditor(SkyHanniMod.feature, activeConfig))));
+ Minecraft.getMinecraft().displayGuiScreen(new GuiPositionEditor(position, width, height, () -> {}, () -> {}, () -> SkyHanniMod.screenToOpen = new GuiScreenElementWrapper(new ConfigEditor(SkyHanniMod.feature, activeConfig))));
}
public void executeRunnable(String runnableId) {
@@ -305,7 +303,6 @@ public class Features {
@ConfigOption(name = "Repo Auto Update", desc = "Update the repository on every startup.")
@ConfigEditorBoolean
public boolean repoAutoUpdate = true;
-
}
public static class Debug {
diff --git a/src/main/java/at/hannibal2/skyhanni/config/commands/Commands.java b/src/main/java/at/hannibal2/skyhanni/config/commands/Commands.java
index 8f3b798f1..c2b60515f 100644
--- a/src/main/java/at/hannibal2/skyhanni/config/commands/Commands.java
+++ b/src/main/java/at/hannibal2/skyhanni/config/commands/Commands.java
@@ -23,16 +23,26 @@ public class Commands {
ClientCommandHandler.instance.registerCommand(new SimpleCommand("sh", mainMenu));
ClientCommandHandler.instance.registerCommand(new SimpleCommand("skyhanni", mainMenu));
- ClientCommandHandler.instance.registerCommand(new SimpleCommand("shreloadlocalrepo", new SimpleCommand.ProcessCommandRunnable() {
- public void processCommand(ICommandSender sender, String[] args) {
- SkyHanniMod.repo.reloadLocalRepo();
- }
- }));
+ ClientCommandHandler.instance.registerCommand(
+ new SimpleCommand(
+ "shreloadlocalrepo",
+ new SimpleCommand.ProcessCommandRunnable() {
+ public void processCommand(ICommandSender sender, String[] args) {
+ SkyHanniMod.repo.reloadLocalRepo();
+ }
+ }
+ )
+ );
- ClientCommandHandler.instance.registerCommand(new SimpleCommand("shupdaterepo", new SimpleCommand.ProcessCommandRunnable() {
- public void processCommand(ICommandSender sender, String[] args) {
- SkyHanniMod.repo.updateRepo();
- }
- }));
+ ClientCommandHandler.instance.registerCommand(
+ new SimpleCommand(
+ "shupdaterepo",
+ new SimpleCommand.ProcessCommandRunnable() {
+ public void processCommand(ICommandSender sender, String[] args) {
+ SkyHanniMod.repo.updateRepo();
+ }
+ }
+ )
+ );
}
}