diff options
author | hannibal00212 <hannibal00212@users.noreply.github.com> | 2022-07-08 14:03:31 +0000 |
---|---|---|
committer | GitHub Action <actions@github.com> | 2022-07-08 14:03:31 +0000 |
commit | 9fa35d8e86c76548f8cbe5d78e2f082104ab93bb (patch) | |
tree | 4f05a355df9c01c672d4ceb443dc706c33b09677 /src/main/java | |
parent | 9e08dbf2baa9819abd281ad285df7462c99491e2 (diff) | |
download | skyhanni-9fa35d8e86c76548f8cbe5d78e2f082104ab93bb.tar.gz skyhanni-9fa35d8e86c76548f8cbe5d78e2f082104ab93bb.tar.bz2 skyhanni-9fa35d8e86c76548f8cbe5d78e2f082104ab93bb.zip |
Prettified Code!
Diffstat (limited to 'src/main/java')
7 files changed, 20 insertions, 26 deletions
diff --git a/src/main/java/at/lorenz/mod/LorenzMod.java b/src/main/java/at/lorenz/mod/LorenzMod.java index 75396d94d..3bd1f8c80 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.commands.Commands; +import java.io.*; +import java.nio.charset.StandardCharsets; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiScreen; import net.minecraft.client.resources.IReloadableResourceManager; @@ -21,16 +23,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; @@ -84,22 +83,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) { @@ -125,8 +122,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 e195f1d1b..01577b16f 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.config.SBHConfigEditor; import com.thatgravyboat.skyblockhud.core.GuiScreenElementWrapper; import com.thatgravyboat.skyblockhud.core.config.Position; @@ -11,7 +11,7 @@ import com.thatgravyboat.skyblockhud.core.config.annotations.ConfigOption; import com.thatgravyboat.skyblockhud.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)))); diff --git a/src/main/java/com/thatgravyboat/skyblockhud/commands/Commands.java b/src/main/java/com/thatgravyboat/skyblockhud/commands/Commands.java index 360c35578..2b058f519 100644 --- a/src/main/java/com/thatgravyboat/skyblockhud/commands/Commands.java +++ b/src/main/java/com/thatgravyboat/skyblockhud/commands/Commands.java @@ -80,7 +80,7 @@ public class Commands { ClientCommandHandler.instance.registerCommand(settingsCommand2); // ClientCommandHandler.instance.registerCommand(mapCommand); // ClientCommandHandler.instance.registerCommand(devCommand); -// ClientCommandHandler.instance.registerCommand(new CrystalWaypoints.WaypointCommand()); + // ClientCommandHandler.instance.registerCommand(new CrystalWaypoints.WaypointCommand()); } // private static void sendSBHMessage(ICommandSender sender, String message) { // sender.addChatMessage(new ChatComponentText("[" + EnumChatFormatting.RED + EnumChatFormatting.BOLD + "SkyBlockHud" + EnumChatFormatting.RESET + "] : " + EnumChatFormatting.GRAY + message)); diff --git a/src/main/java/com/thatgravyboat/skyblockhud/core/config/Config.java b/src/main/java/com/thatgravyboat/skyblockhud/core/config/Config.java index 6baf651b4..97a34ff23 100644 --- a/src/main/java/com/thatgravyboat/skyblockhud/core/config/Config.java +++ b/src/main/java/com/thatgravyboat/skyblockhud/core/config/Config.java @@ -1,5 +1,4 @@ package com.thatgravyboat.skyblockhud.core.config; - //public class Config { // // public void executeRunnable(String runnableId) {} diff --git a/src/main/java/com/thatgravyboat/skyblockhud/handlers/WarpHandler.java b/src/main/java/com/thatgravyboat/skyblockhud/handlers/WarpHandler.java index d92851cb3..47cac22ed 100644 --- a/src/main/java/com/thatgravyboat/skyblockhud/handlers/WarpHandler.java +++ b/src/main/java/com/thatgravyboat/skyblockhud/handlers/WarpHandler.java @@ -1,9 +1,9 @@ package com.thatgravyboat.skyblockhud.handlers; +import at.lorenz.mod.LorenzMod; import com.google.common.collect.HashMultimap; import com.google.common.collect.SetMultimap; import com.google.gson.*; -import at.lorenz.mod.LorenzMod; import com.thatgravyboat.skyblockhud.api.events.ProfileJoinedEvent; import com.thatgravyboat.skyblockhud.api.events.ProfileSwitchedEvent; import com.thatgravyboat.skyblockhud.mixins.GuiChestAccessor; diff --git a/src/main/java/com/thatgravyboat/skyblockhud/textures/Textures.java b/src/main/java/com/thatgravyboat/skyblockhud/textures/Textures.java index bddc76339..2a6975b32 100644 --- a/src/main/java/com/thatgravyboat/skyblockhud/textures/Textures.java +++ b/src/main/java/com/thatgravyboat/skyblockhud/textures/Textures.java @@ -1,11 +1,11 @@ package com.thatgravyboat.skyblockhud.textures; +import at.lorenz.mod.LorenzMod; import com.google.common.collect.Lists; import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.google.gson.JsonElement; import com.google.gson.JsonObject; -import at.lorenz.mod.LorenzMod; import java.io.BufferedReader; import java.io.InputStreamReader; import java.nio.charset.StandardCharsets; @@ -26,7 +26,7 @@ public class Textures implements IResourceManagerReloadListener { public static void setTexture(int selected) { if (selected >= styles.size() || selected < 0) { texture = DEFAULT_TEXTURE; -// LorenzMod.config.misc.style = 0; + // LorenzMod.config.misc.style = 0; } else { texture = styles.get(selected); } @@ -52,7 +52,6 @@ public class Textures implements IResourceManagerReloadListener { } } } catch (Exception ignored) {} - -// if (LorenzMod.config != null) setTexture(LorenzMod.config.misc.style); + // if (LorenzMod.config != null) setTexture(LorenzMod.config.misc.style); } } diff --git a/src/main/java/com/thatgravyboat/skyblockhud/utils/Utils.java b/src/main/java/com/thatgravyboat/skyblockhud/utils/Utils.java index 2dd0d291e..f7aae5bcc 100644 --- a/src/main/java/com/thatgravyboat/skyblockhud/utils/Utils.java +++ b/src/main/java/com/thatgravyboat/skyblockhud/utils/Utils.java @@ -46,12 +46,12 @@ public class Utils { return input.toLowerCase().replace(" ", "").replace(replace, ""); } -// public static boolean isPlayerHoldingRedstone(EntityPlayerSP player) { -// if (!LorenzMod.config.main.requireRedstone) return true; -// ArrayList<Item> redstoneItems = new ArrayList<>(Arrays.asList(Items.redstone, Items.repeater, Items.comparator, Item.getByNameOrId("minecraft:redstone_torch"))); -// if (player.getHeldItem() != null) return redstoneItems.contains(player.getHeldItem().getItem()); -// return false; -// } + // public static boolean isPlayerHoldingRedstone(EntityPlayerSP player) { + // if (!LorenzMod.config.main.requireRedstone) return true; + // ArrayList<Item> redstoneItems = new ArrayList<>(Arrays.asList(Items.redstone, Items.repeater, Items.comparator, Item.getByNameOrId("minecraft:redstone_torch"))); + // if (player.getHeldItem() != null) return redstoneItems.contains(player.getHeldItem().getItem()); + // return false; + // } public static boolean inRangeInclusive(int value, int min, int max) { return value <= max && value >= min; |