diff options
author | ThatGravyBoat <thatgravyboat@gmail.com> | 2021-07-13 01:51:19 -0230 |
---|---|---|
committer | ThatGravyBoat <thatgravyboat@gmail.com> | 2021-07-13 01:51:19 -0230 |
commit | 3bd212839e1d3c497a840221a0c149451967467e (patch) | |
tree | 9a306491b76808a17a26c6bef6f74c08cbc99964 /src/main/java | |
parent | 087d97fb0663edc5e343187c0fa4ec1bc6b081bc (diff) | |
download | SkyblockHud-Death-Defied-3bd212839e1d3c497a840221a0c149451967467e.tar.gz SkyblockHud-Death-Defied-3bd212839e1d3c497a840221a0c149451967467e.tar.bz2 SkyblockHud-Death-Defied-3bd212839e1d3c497a840221a0c149451967467e.zip |
Added 2 new subcommands to crystal waypoints, Added medals shown in farmhouse, Added config option to stop auto flipping of rpg hud, Added option so if exp bar is still being rendered it should hide when holding drill to not overlay them and keep a consistent hud
Diffstat (limited to 'src/main/java')
11 files changed, 175 insertions, 48 deletions
diff --git a/src/main/java/com/thatgravyboat/skyblockhud/SkyblockHud.java b/src/main/java/com/thatgravyboat/skyblockhud/SkyblockHud.java index 92564b8..539a42f 100644 --- a/src/main/java/com/thatgravyboat/skyblockhud/SkyblockHud.java +++ b/src/main/java/com/thatgravyboat/skyblockhud/SkyblockHud.java @@ -10,10 +10,7 @@ import com.thatgravyboat.skyblockhud.config.KeyBindings; import com.thatgravyboat.skyblockhud.config.SBHConfig; import com.thatgravyboat.skyblockhud.dungeons.DungeonHandler; import com.thatgravyboat.skyblockhud.handlers.*; -import com.thatgravyboat.skyblockhud.location.FarmingIslandHandler; -import com.thatgravyboat.skyblockhud.location.IslandHandler; -import com.thatgravyboat.skyblockhud.location.LocationHandler; -import com.thatgravyboat.skyblockhud.location.MinesHandler; +import com.thatgravyboat.skyblockhud.location.*; import com.thatgravyboat.skyblockhud.overlay.DungeonOverlay; import com.thatgravyboat.skyblockhud.overlay.MiningHud; import com.thatgravyboat.skyblockhud.overlay.OverlayHud; @@ -83,6 +80,7 @@ public class SkyblockHud { MinecraftForge.EVENT_BUS.register(new ComponentHandler()); MinecraftForge.EVENT_BUS.register(new ActionBarParsing()); MinecraftForge.EVENT_BUS.register(new CrystalWaypoints()); + MinecraftForge.EVENT_BUS.register(new FarmHouseHandler()); Commands.init(); configFile = new File(event.getModConfigurationDirectory(), "sbh-config.json"); diff --git a/src/main/java/com/thatgravyboat/skyblockhud/config/SBHConfig.java b/src/main/java/com/thatgravyboat/skyblockhud/config/SBHConfig.java index db3e6df..8d84833 100644 --- a/src/main/java/com/thatgravyboat/skyblockhud/config/SBHConfig.java +++ b/src/main/java/com/thatgravyboat/skyblockhud/config/SBHConfig.java @@ -81,8 +81,8 @@ public class SBHConfig extends Config { public Map map = new Map(); @Expose - @Category(name = "Mining Hud", desc = "All Options for the Mining Hud.") - public MiningHud miningHud = new MiningHud(); + @Category(name = "Mining", desc = "All Options for the Mining Stuff.") + public Mining mining = new Mining(); //TODO ENABLED WHEN TRACKER GETS ADDED BACK // @Expose @@ -128,6 +128,11 @@ public class SBHConfig extends Config { public boolean showRpgHud = true; @Expose + @ConfigOption(name = "Flip Hud", desc = "Flips the hud when half way across the screen.") + @ConfigEditorBoolean + public boolean flipHud = true; + + @Expose @ConfigOption(name = "RPG Hud Position", desc = "Allows you to change the position of the RPG Hud.") @ConfigEditorButton(runnableId = "rpg", buttonText = "Edit") public Position rpgHudPosition = new Position(1, 1); @@ -309,7 +314,7 @@ public class SBHConfig extends Config { public boolean showQuestIcons = false; } - public static class MiningHud { + public static class Mining { @Expose @ConfigOption(name = "Show Drill Bar", desc = "Allows you to show or hide the Drill Bar.") @@ -320,6 +325,11 @@ public class SBHConfig extends Config { @ConfigOption(name = "Show Heat Bar", desc = "Allows you to show or hide the Heat Bar.") @ConfigEditorBoolean public boolean showHeatBar = true; + + @Expose + @ConfigOption(name = "Auto Waypoint", desc = "Turns on auto waypoints for the main areas of crystal hollows.") + @ConfigEditorBoolean + public boolean autoWaypoint = true; } public static class Trackers { diff --git a/src/main/java/com/thatgravyboat/skyblockhud/handlers/CrystalWaypoints.java b/src/main/java/com/thatgravyboat/skyblockhud/handlers/CrystalWaypoints.java index 079e108..0932ab1 100644 --- a/src/main/java/com/thatgravyboat/skyblockhud/handlers/CrystalWaypoints.java +++ b/src/main/java/com/thatgravyboat/skyblockhud/handlers/CrystalWaypoints.java @@ -1,14 +1,21 @@ package com.thatgravyboat.skyblockhud.handlers; import com.google.common.collect.Lists; +import com.google.common.collect.Sets; +import com.thatgravyboat.skyblockhud.SkyblockHud; import com.thatgravyboat.skyblockhud.Utils; import com.thatgravyboat.skyblockhud.api.events.LocationChangeEvent; import com.thatgravyboat.skyblockhud.commands.SimpleCommand; import com.thatgravyboat.skyblockhud.location.LocationCategory; import com.thatgravyboat.skyblockhud.location.LocationHandler; +import com.thatgravyboat.skyblockhud.location.Locations; +import java.awt.*; +import java.awt.datatransfer.StringSelection; import java.util.Arrays; import java.util.HashMap; import java.util.List; +import java.util.Set; +import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.GlStateManager; import net.minecraft.command.ICommandSender; import net.minecraft.util.BlockPos; @@ -21,15 +28,13 @@ public class CrystalWaypoints { public static final HashMap<String, BlockPos> waypoints = new HashMap<>(); + private static final Set<Locations> IMPORTANT_WAYPOINTS = Sets.newHashSet(Locations.GOBLINQUEENSDEN, Locations.LOSTPRECURSORCITY, Locations.JUNGLETEMPLE, Locations.MINESOFDIVAN); + @SubscribeEvent public void onRenderLast(RenderWorldLastEvent event) { - waypoints.forEach( - (text, pos) -> { - GlStateManager.disableCull(); - GlStateManager.disableDepth(); - Utils.renderWaypointText(text, pos, event.partialTicks); - } - ); + GlStateManager.disableCull(); + GlStateManager.disableDepth(); + waypoints.forEach((text, pos) -> Utils.renderWaypointText(text, pos, event.partialTicks)); GlStateManager.enableCull(); GlStateManager.enableDepth(); } @@ -39,6 +44,14 @@ public class CrystalWaypoints { 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)); + } + 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()); + } + } } public static class WaypointCommand extends SimpleCommand { @@ -49,15 +62,18 @@ public class CrystalWaypoints { new ProcessCommandRunnable() { @Override public void processCommand(ICommandSender sender, String[] args) { + if (args.length == 0) return; String subCommand = args[0].toLowerCase(); String name = String.join(" ", Arrays.copyOfRange(args, 1, args.length)); switch (subCommand) { case "add": if (LocationHandler.getCurrentLocation().getCategory().equals(LocationCategory.CRYSTALHOLLOWS)) { - if (!CrystalWaypoints.waypoints.containsKey(name)) { + if (!CrystalWaypoints.waypoints.containsKey(name) && name.length() > 1) { CrystalWaypoints.waypoints.put(name, sender.getPosition().add(0.5, 0.5, 0.5)); + } else if (name.length() < 2) { + sbhMessage(sender, "Waypoint name needs to be longer than 1"); } else { - sender.addChatMessage(new ChatComponentText("[" + EnumChatFormatting.RED + EnumChatFormatting.BOLD + "SkyBlockHud" + EnumChatFormatting.RESET + "] : " + EnumChatFormatting.GRAY + "Waypoint already exists!")); + sbhMessage(sender, "Waypoint already exists!"); } } break; @@ -66,29 +82,61 @@ public class CrystalWaypoints { if (CrystalWaypoints.waypoints.containsKey(name)) { CrystalWaypoints.waypoints.remove(name); } else { - sender.addChatMessage(new ChatComponentText("[" + EnumChatFormatting.RED + EnumChatFormatting.BOLD + "SkyBlockHud" + EnumChatFormatting.RESET + "] : " + EnumChatFormatting.GRAY + "Waypoint doesnt exist!")); + sbhMessage(sender, "Waypoint doesnt exist!"); } } break; case "clear": CrystalWaypoints.waypoints.clear(); break; + case "addat": + if (LocationHandler.getCurrentLocation().getCategory().equals(LocationCategory.CRYSTALHOLLOWS)) { + name = String.join(" ", Arrays.copyOfRange(args, 4, args.length)); + try { + if (!CrystalWaypoints.waypoints.containsKey(name)) { + CrystalWaypoints.waypoints.put(name, parseBlockPos(sender, args, 1, true)); + } else if (name.length() < 2) { + sbhMessage(sender, "Waypoint name needs to be longer than 1"); + } else { + sbhMessage(sender, "Waypoint already exists!"); + } + }catch (Exception e){ + sbhMessage(sender, "Error!"); + } + } + break; + case "copy": + BlockPos pos = waypoints.get(name); + if (pos == null) { + sbhMessage(sender, "No waypoint with that name!"); + break; + } + StringSelection clipboard = new StringSelection(name + " : ("+pos.getX()+"/"+pos.getY()+"/"+pos.getZ()+")"); + Toolkit.getDefaultToolkit().getSystemClipboard().setContents(clipboard, clipboard); + break; } } }, new TabCompleteRunnable() { @Override public List<String> tabComplete(ICommandSender sender, String[] args, BlockPos pos) { - if (args.length == 2 && args[0].equalsIgnoreCase("remove")) { + if (args.length == 2 && (args[0].equalsIgnoreCase("remove") || args[0].equalsIgnoreCase("copy"))) { return getListOfStringsMatchingLastWord(args, waypoints.keySet()); } if (args.length == 1) { - return getListOfStringsMatchingLastWord(args, Lists.newArrayList("add", "clear", "remove")); + return getListOfStringsMatchingLastWord(args, Lists.newArrayList("add", "clear", "remove", "copy", "addat")); + } + if (args.length > 1 && args[0].equalsIgnoreCase("addat")){ + return func_175771_a(args, 1, pos); } return null; } } ); } + + 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 64cc7dc..e7143a9 100644 --- a/src/main/java/com/thatgravyboat/skyblockhud/handlers/MapHandler.java +++ b/src/main/java/com/thatgravyboat/skyblockhud/handlers/MapHandler.java @@ -1,7 +1,5 @@ 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; @@ -26,6 +24,8 @@ 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 { @@ -126,10 +126,10 @@ public class MapHandler { mc.renderEngine.bindTexture(mapOverlay); Gui.drawModalRectWithCustomSizedTexture(pos.getAbsX(event.resolution, 72), pos.getAbsY(event.resolution, 72), 0, 0, 72, 72, 256, 256); String keyCode = GameSettings.getKeyDisplayString(KeyBindings.map.getKeyCode()); - Utils.drawStringCenteredScaled(keyCode, mc.fontRendererObj, pos.getAbsX(event.resolution, 64) + 58, pos.getAbsY(event.resolution, 72) + 66, false, 6, 0xFFFFFF); + Utils.drawStringCenteredScaled(keyCode, mc.fontRendererObj, pos.getAbsX(event.resolution, 64) + (pos.rightAligned(event.resolution, 72) ? 50 : 58), pos.getAbsY(event.resolution, 72) + 66, false, 6, 0xFFFFFF); BlockPos playerPos = mc.thePlayer.getPosition(); String position = String.format("%d/%d/%d", playerPos.getX(), playerPos.getY(), playerPos.getZ()); - Utils.drawStringCenteredScaled(position, mc.fontRendererObj, pos.getAbsX(event.resolution, 64) + 29, pos.getAbsY(event.resolution, 72) + 66, false, 36, 0xFFFFFF); + Utils.drawStringCenteredScaled(position, mc.fontRendererObj, pos.getAbsX(event.resolution, 64) + (pos.rightAligned(event.resolution, 72) ? 21 : 29), pos.getAbsY(event.resolution, 72) + 66, false, 36, 0xFFFFFF); GlStateManager.color(1.0f, 1.0f, 1.0f, 1.0f); } } diff --git a/src/main/java/com/thatgravyboat/skyblockhud/handlers/SlayerHandler.java b/src/main/java/com/thatgravyboat/skyblockhud/handlers/SlayerHandler.java index 67bde54..49b2928 100644 --- a/src/main/java/com/thatgravyboat/skyblockhud/handlers/SlayerHandler.java +++ b/src/main/java/com/thatgravyboat/skyblockhud/handlers/SlayerHandler.java @@ -11,8 +11,6 @@ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; public class SlayerHandler { - //Optional Characters are required because Hypixel dumb and cuts off text - private static final Pattern COMBAT_XP_REGEX = Pattern.compile("\\(([\\d,]+)/([\\dkm]+)\\) comb?a?t? x?p?"); private static final Pattern KILLS_REGEX = Pattern.compile("(\\d+)/(\\d+) kills?"); public enum slayerTypes { @@ -91,7 +89,6 @@ public class SlayerHandler { if (isDoingSlayer) { String line = event.formattedLine.toLowerCase(); Matcher killMatcher = KILLS_REGEX.matcher(line); - Matcher xpMatcher = COMBAT_XP_REGEX.matcher(line); if (killMatcher.find()) { SlayerHandler.bossSlain = false; @@ -102,15 +99,6 @@ public class SlayerHandler { try { maxKills = Integer.parseInt(killMatcher.group(2)); } catch (Exception ignored) {} - } else if (xpMatcher.find()) { - SlayerHandler.bossSlain = false; - SlayerHandler.isKillingBoss = false; - try { - progress = Integer.parseInt(xpMatcher.group(1)); - } catch (Exception ignored) {} - try { - maxKills = Integer.parseInt(xpMatcher.group(2).replace("k", "")) * (xpMatcher.group(2).contains("k") ? 1000 : xpMatcher.group(2).contains("m") ? 1000000 : 1); - } catch (Exception ignored) {} } else if (line.contains("slay the boss")) { SlayerHandler.bossSlain = false; SlayerHandler.isKillingBoss = true; @@ -122,10 +110,6 @@ public class SlayerHandler { SlayerHandler.progress = 0; SlayerHandler.bossSlain = true; } - if (maxKills == 0 && progress == 0) { - SlayerHandler.maxKills = 0; - SlayerHandler.progress = 0; - } } } } diff --git a/src/main/java/com/thatgravyboat/skyblockhud/location/FarmHouseHandler.java b/src/main/java/com/thatgravyboat/skyblockhud/location/FarmHouseHandler.java new file mode 100644 index 0000000..432bfbb --- /dev/null +++ b/src/main/java/com/thatgravyboat/skyblockhud/location/FarmHouseHandler.java @@ -0,0 +1,42 @@ +package com.thatgravyboat.skyblockhud.location; + +import com.thatgravyboat.skyblockhud.api.events.ProfileSwitchedEvent; +import com.thatgravyboat.skyblockhud.api.events.SidebarLineUpdateEvent; +import java.util.Arrays; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; + +public class FarmHouseHandler { + + public enum Medal { + BRONZE, + SILVER, + GOLD + } + + private static final int[] medals = new int[Medal.values().length]; + + @SubscribeEvent + public void onSidebarLineUpdate(SidebarLineUpdateEvent event) { + if (event.formattedLine.contains("medals:")){ + for (Medal value : Medal.values()) { + if (event.formattedLine.contains(value.name())){ + try { + medals[value.ordinal()] = Integer.parseInt(event.formattedLine.replace("medals:", "").replace(value.name(), "").trim()); + }catch (Exception ignored){} + break; + } + } + } + } + + @SubscribeEvent + public void onProfileSwitch(ProfileSwitchedEvent event){ + Arrays.fill(medals, 0); + } + + 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 9886ba0..873b7bf 100644 --- a/src/main/java/com/thatgravyboat/skyblockhud/mixins/MixinGuiIngameForge.java +++ b/src/main/java/com/thatgravyboat/skyblockhud/mixins/MixinGuiIngameForge.java @@ -1,8 +1,9 @@ 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; +import net.minecraft.client.Minecraft; import net.minecraftforge.client.GuiIngameForge; import net.minecraftforge.client.event.RenderGameOverlayEvent; import net.minecraftforge.common.MinecraftForge; @@ -12,6 +13,8 @@ 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 { @@ -60,6 +63,12 @@ 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())){ + ci.cancel(); + if (pre(EXPERIENCE)) return; + post(EXPERIENCE); + } } } diff --git a/src/main/java/com/thatgravyboat/skyblockhud/overlay/MiningHud.java b/src/main/java/com/thatgravyboat/skyblockhud/overlay/MiningHud.java index 273f98d..2c2feaa 100644 --- a/src/main/java/com/thatgravyboat/skyblockhud/overlay/MiningHud.java +++ b/src/main/java/com/thatgravyboat/skyblockhud/overlay/MiningHud.java @@ -23,17 +23,21 @@ public class MiningHud extends Gui { MiningHud.heat = heat; } + public static int getHeat() { + return heat; + } + @SubscribeEvent public void renderOverlay(RenderGameOverlayEvent.Post event) { - if (Utils.overlayShouldRender(event.type, SkyblockHud.hasSkyblockScoreboard(), SkyblockHud.config.miningHud.showDrillBar || SkyblockHud.config.miningHud.showHeatBar)) { + if (Utils.overlayShouldRender(event.type, SkyblockHud.hasSkyblockScoreboard(), SkyblockHud.config.mining.showDrillBar || SkyblockHud.config.mining.showHeatBar)) { Minecraft mc = Minecraft.getMinecraft(); - if (heat > 0 && Utils.isDrill(mc.thePlayer.getHeldItem()) && SkyblockHud.config.miningHud.showDrillBar && SkyblockHud.config.miningHud.showHeatBar) { + if (heat > 0 && Utils.isDrill(mc.thePlayer.getHeldItem()) && SkyblockHud.config.mining.showDrillBar && SkyblockHud.config.mining.showHeatBar) { renderFuelBar(mc, (event.resolution.getScaledWidth() / 2) - 91, event.resolution.getScaledHeight() - 31); renderHeatBar(mc, (event.resolution.getScaledWidth() / 2) + 46, event.resolution.getScaledHeight() - 31); - } else if (Utils.isDrill(mc.thePlayer.getHeldItem()) && SkyblockHud.config.miningHud.showDrillBar) { + } else if (Utils.isDrill(mc.thePlayer.getHeldItem()) && SkyblockHud.config.mining.showDrillBar) { renderFuelBar(mc, (event.resolution.getScaledWidth() / 2) - 68, event.resolution.getScaledHeight() - 31); - } else if (heat > 0 && SkyblockHud.config.miningHud.showHeatBar) { + } else if (heat > 0 && SkyblockHud.config.mining.showHeatBar) { renderHeatBar(mc, (event.resolution.getScaledWidth() / 2) - 22, event.resolution.getScaledHeight() - 31); } } diff --git a/src/main/java/com/thatgravyboat/skyblockhud/overlay/OverlayHud.java b/src/main/java/com/thatgravyboat/skyblockhud/overlay/OverlayHud.java index a1e1f54..8c64ddd 100644 --- a/src/main/java/com/thatgravyboat/skyblockhud/overlay/OverlayHud.java +++ b/src/main/java/com/thatgravyboat/skyblockhud/overlay/OverlayHud.java @@ -60,6 +60,9 @@ public class OverlayHud extends Gui { // LOCATION drawLocation(width, offset, mc); + //FARMHOUSE + drawFarmHouseMedals(width, offset, mc); + //EXTRA SLOT if (LocationHandler.getCurrentLocation().equals(Locations.YOURISLAND)) { if (IslandHandler.flightTime > 0) drawFlightDuration(width, offset, mc); @@ -273,6 +276,24 @@ public class OverlayHud extends Gui { } } + public void drawFarmHouseMedals(int width, int offset, Minecraft mc) { + if (LocationHandler.getCurrentLocation().equals(Locations.FARMHOUSE)) { + int bronze = font.getStringWidth(FarmHouseHandler.getFormattedMedals(FarmHouseHandler.Medal.BRONZE)); + int silver = font.getStringWidth(FarmHouseHandler.getFormattedMedals(FarmHouseHandler.Medal.SILVER)); + int gold = font.getStringWidth(FarmHouseHandler.getFormattedMedals(FarmHouseHandler.Medal.GOLD)); + + int end = drawLeftBottomBar(width, offset, 40 + bronze + silver + gold, mc); + drawTexturedModalRect(end + 2, offset + (bossBarVisible ? 38 : 21), 139, 0, 8, 8); + drawTexturedModalRect(end + 14 + gold, offset + (bossBarVisible ? 38 : 21), 147, 0, 8, 8); + drawTexturedModalRect(end + 26 + gold + silver, offset + (bossBarVisible ? 38 : 21), 155, 0, 8, 8); + + 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); + + } + } + @SubscribeEvent public void renderOverlay(RenderGameOverlayEvent.Post event) { if (Utils.overlayShouldRender(event.type, SkyblockHud.hasSkyblockScoreboard())) { @@ -291,4 +312,15 @@ public class OverlayHud extends Gui { drawCenteredString(font, text, (int) (x / factor), (int) (y / factor), color); 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); + int edge = (width / 2) - 17; + + drawTexturedModalRect(edge - barWidth, offset + (bossBarVisible ? 35 : 18), 0, 34, 2, 14); + drawTexturedModalRect(edge - barWidth + 2, offset + (bossBarVisible ? 35 : 18), 2, 34, barWidth - 2, 14); + return edge - barWidth + 2; + } } diff --git a/src/main/java/com/thatgravyboat/skyblockhud/overlay/RPGHud.java b/src/main/java/com/thatgravyboat/skyblockhud/overlay/RPGHud.java index 9d0f00d..ef19553 100644 --- a/src/main/java/com/thatgravyboat/skyblockhud/overlay/RPGHud.java +++ b/src/main/java/com/thatgravyboat/skyblockhud/overlay/RPGHud.java @@ -67,7 +67,7 @@ public class RPGHud extends Gui { int x = position.getAbsX(event.resolution, 120); int y = position.getAbsY(event.resolution, 47); - boolean rightAligned = position.rightAligned(event.resolution, 120); + boolean rightAligned = position.rightAligned(event.resolution, 120) && SkyblockHud.config.rpg.flipHud; drawTexturedModalRect(x, y, rightAligned ? 131 : 5, 6, 120, 47); diff --git a/src/main/java/com/thatgravyboat/skyblockhud/playerstats/ActionBarParsing.java b/src/main/java/com/thatgravyboat/skyblockhud/playerstats/ActionBarParsing.java index 5c5f5d5..1934020 100644 --- a/src/main/java/com/thatgravyboat/skyblockhud/playerstats/ActionBarParsing.java +++ b/src/main/java/com/thatgravyboat/skyblockhud/playerstats/ActionBarParsing.java @@ -56,7 +56,7 @@ public class ActionBarParsing { if (SkyblockHud.hasSkyblockScoreboard() && SkyblockHud.config.rpg.showRpgHud) { parseActionBar(event.message.getUnformattedText()); } - if (SkyblockHud.config.miningHud.showDrillBar) { + if (SkyblockHud.config.mining.showDrillBar) { String bar = Utils.removeColor(event.message.getUnformattedText()); Matcher DrillFuelMatcher = DrillFuelRegex.matcher(bar); if (DrillFuelMatcher.find()) { @@ -90,7 +90,7 @@ public class ActionBarParsing { } event.message = lastLowEditedActionBar; } - if (SkyblockHud.config.miningHud.showDrillBar) { + if (SkyblockHud.config.mining.showDrillBar) { event.message = new ChatComponentText(DrillFuelReplaceRegex.matcher(event.message.getUnformattedText()).replaceAll("").trim()); } } |