diff options
author | ThatGravyBoat <ThatGravyBoat@users.noreply.github.com> | 2021-07-13 04:22:16 +0000 |
---|---|---|
committer | GitHub Action <actions@github.com> | 2021-07-13 04:22:16 +0000 |
commit | b3b16e4c82ad1e66f5564c806563dfc23658fdef (patch) | |
tree | 676f37e897537a4820204c30b52b8bc9379c324a /src | |
parent | 3bd212839e1d3c497a840221a0c149451967467e (diff) | |
download | SkyblockHud-Death-Defied-b3b16e4c82ad1e66f5564c806563dfc23658fdef.tar.gz SkyblockHud-Death-Defied-b3b16e4c82ad1e66f5564c806563dfc23658fdef.tar.bz2 SkyblockHud-Death-Defied-b3b16e4c82ad1e66f5564c806563dfc23658fdef.zip |
Prettified Code!
Diffstat (limited to 'src')
5 files changed, 19 insertions, 23 deletions
diff --git a/src/main/java/com/thatgravyboat/skyblockhud/handlers/CrystalWaypoints.java b/src/main/java/com/thatgravyboat/skyblockhud/handlers/CrystalWaypoints.java index 0932ab1..d6e4fd6 100644 --- a/src/main/java/com/thatgravyboat/skyblockhud/handlers/CrystalWaypoints.java +++ b/src/main/java/com/thatgravyboat/skyblockhud/handlers/CrystalWaypoints.java @@ -43,12 +43,11 @@ public class CrystalWaypoints { public void onLocationChange(LocationChangeEvent event) { if (!event.newLocation.getCategory().equals(LocationCategory.CRYSTALHOLLOWS)) { waypoints.clear(); + } else if (!waypoints.containsKey("Crystal Nucleus") && SkyblockHud.config.mining.autoWaypoint) { + waypoints.put("Crystal Nucleus", new BlockPos(512.5, 106.5, 512.5)); } - else if (!waypoints.containsKey("Crystal Nucleus") && SkyblockHud.config.mining.autoWaypoint){ - waypoints.put("Crystal Nucleus", new BlockPos(512.5,106.5,512.5)); - } - if (IMPORTANT_WAYPOINTS.contains(event.newLocation) && SkyblockHud.config.mining.autoWaypoint){ - if (!waypoints.containsKey(event.newLocation.getDisplayName())){ + if (IMPORTANT_WAYPOINTS.contains(event.newLocation) && SkyblockHud.config.mining.autoWaypoint) { + if (!waypoints.containsKey(event.newLocation.getDisplayName())) { waypoints.put(event.newLocation.getDisplayName(), Minecraft.getMinecraft().thePlayer.getPosition()); } } @@ -100,7 +99,7 @@ public class CrystalWaypoints { } else { sbhMessage(sender, "Waypoint already exists!"); } - }catch (Exception e){ + } catch (Exception e) { sbhMessage(sender, "Error!"); } } @@ -111,7 +110,7 @@ public class CrystalWaypoints { sbhMessage(sender, "No waypoint with that name!"); break; } - StringSelection clipboard = new StringSelection(name + " : ("+pos.getX()+"/"+pos.getY()+"/"+pos.getZ()+")"); + StringSelection clipboard = new StringSelection(name + " : (" + pos.getX() + "/" + pos.getY() + "/" + pos.getZ() + ")"); Toolkit.getDefaultToolkit().getSystemClipboard().setContents(clipboard, clipboard); break; } @@ -126,7 +125,7 @@ public class CrystalWaypoints { if (args.length == 1) { return getListOfStringsMatchingLastWord(args, Lists.newArrayList("add", "clear", "remove", "copy", "addat")); } - if (args.length > 1 && args[0].equalsIgnoreCase("addat")){ + if (args.length > 1 && args[0].equalsIgnoreCase("addat")) { return func_175771_a(args, 1, pos); } return null; @@ -135,7 +134,7 @@ public class CrystalWaypoints { ); } - private static void sbhMessage(ICommandSender sender, String message){ + private static void sbhMessage(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/handlers/MapHandler.java b/src/main/java/com/thatgravyboat/skyblockhud/handlers/MapHandler.java index e7143a9..bf38d49 100644 --- a/src/main/java/com/thatgravyboat/skyblockhud/handlers/MapHandler.java +++ b/src/main/java/com/thatgravyboat/skyblockhud/handlers/MapHandler.java @@ -1,5 +1,7 @@ package com.thatgravyboat.skyblockhud.handlers; +import static com.thatgravyboat.skyblockhud.GuiTextures.mapOverlay; + import com.thatgravyboat.skyblockhud.SkyblockHud; import com.thatgravyboat.skyblockhud.Utils; import com.thatgravyboat.skyblockhud.config.KeyBindings; @@ -24,8 +26,6 @@ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import net.minecraftforge.fml.common.gameevent.TickEvent; import org.lwjgl.opengl.GL11; -import static com.thatgravyboat.skyblockhud.GuiTextures.mapOverlay; - public class MapHandler { public enum MapIconTypes { diff --git a/src/main/java/com/thatgravyboat/skyblockhud/location/FarmHouseHandler.java b/src/main/java/com/thatgravyboat/skyblockhud/location/FarmHouseHandler.java index 432bfbb..005d9ff 100644 --- a/src/main/java/com/thatgravyboat/skyblockhud/location/FarmHouseHandler.java +++ b/src/main/java/com/thatgravyboat/skyblockhud/location/FarmHouseHandler.java @@ -17,12 +17,12 @@ public class FarmHouseHandler { @SubscribeEvent public void onSidebarLineUpdate(SidebarLineUpdateEvent event) { - if (event.formattedLine.contains("medals:")){ + if (event.formattedLine.contains("medals:")) { for (Medal value : Medal.values()) { - if (event.formattedLine.contains(value.name())){ + if (event.formattedLine.contains(value.name())) { try { medals[value.ordinal()] = Integer.parseInt(event.formattedLine.replace("medals:", "").replace(value.name(), "").trim()); - }catch (Exception ignored){} + } catch (Exception ignored) {} break; } } @@ -30,13 +30,12 @@ public class FarmHouseHandler { } @SubscribeEvent - public void onProfileSwitch(ProfileSwitchedEvent event){ + public void onProfileSwitch(ProfileSwitchedEvent event) { Arrays.fill(medals, 0); } - public static String getFormattedMedals(Medal medal){ + public static String getFormattedMedals(Medal medal) { if (medal == null) return "0"; return String.valueOf(medals[medal.ordinal()]); } - } diff --git a/src/main/java/com/thatgravyboat/skyblockhud/mixins/MixinGuiIngameForge.java b/src/main/java/com/thatgravyboat/skyblockhud/mixins/MixinGuiIngameForge.java index 873b7bf..5d64950 100644 --- a/src/main/java/com/thatgravyboat/skyblockhud/mixins/MixinGuiIngameForge.java +++ b/src/main/java/com/thatgravyboat/skyblockhud/mixins/MixinGuiIngameForge.java @@ -1,5 +1,7 @@ package com.thatgravyboat.skyblockhud.mixins; +import static net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType.*; + import com.thatgravyboat.skyblockhud.SkyblockHud; import com.thatgravyboat.skyblockhud.Utils; import com.thatgravyboat.skyblockhud.overlay.MiningHud; @@ -13,8 +15,6 @@ import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; -import static net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType.*; - @Mixin(GuiIngameForge.class) public class MixinGuiIngameForge { @@ -63,8 +63,8 @@ public class MixinGuiIngameForge { ci.cancel(); if (pre(EXPERIENCE)) return; post(EXPERIENCE); - } else if (!SkyblockHud.config.renderer.hideXpBar && (SkyblockHud.config.mining.showDrillBar || SkyblockHud.config.mining.showHeatBar) && SkyblockHud.hasSkyblockScoreboard()){ - if (MiningHud.getHeat() > 0 || Utils.isDrill(Minecraft.getMinecraft().thePlayer.getHeldItem())){ + } else if (!SkyblockHud.config.renderer.hideXpBar && (SkyblockHud.config.mining.showDrillBar || SkyblockHud.config.mining.showHeatBar) && SkyblockHud.hasSkyblockScoreboard()) { + if (MiningHud.getHeat() > 0 || Utils.isDrill(Minecraft.getMinecraft().thePlayer.getHeldItem())) { ci.cancel(); if (pre(EXPERIENCE)) return; post(EXPERIENCE); diff --git a/src/main/java/com/thatgravyboat/skyblockhud/overlay/OverlayHud.java b/src/main/java/com/thatgravyboat/skyblockhud/overlay/OverlayHud.java index 8c64ddd..58c02fd 100644 --- a/src/main/java/com/thatgravyboat/skyblockhud/overlay/OverlayHud.java +++ b/src/main/java/com/thatgravyboat/skyblockhud/overlay/OverlayHud.java @@ -290,7 +290,6 @@ public class OverlayHud extends Gui { drawString(font, FarmHouseHandler.getFormattedMedals(FarmHouseHandler.Medal.GOLD), end + 12, offset + (bossBarVisible ? 38 : 21), 0xffffff); drawString(font, FarmHouseHandler.getFormattedMedals(FarmHouseHandler.Medal.SILVER), end + gold + 24, offset + (bossBarVisible ? 38 : 21), 0xffffff); drawString(font, FarmHouseHandler.getFormattedMedals(FarmHouseHandler.Medal.BRONZE), end + gold + silver + 36, offset + (bossBarVisible ? 38 : 21), 0xffffff); - } } @@ -313,7 +312,6 @@ public class OverlayHud extends Gui { GlStateManager.scale(1 / factor, 1 / factor, 1); } - public int drawLeftBottomBar(int width, int offset, int barWidth, Minecraft mc) { GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); mc.renderEngine.bindTexture(GuiTextures.overlay); |