diff options
author | Lorenz <ESs95s3P5z8Pheb> | 2022-07-08 12:06:49 +0200 |
---|---|---|
committer | Lorenz <ESs95s3P5z8Pheb> | 2022-07-08 12:06:49 +0200 |
commit | c167f4e84e22da7b7c4405b5d59c817734654fc0 (patch) | |
tree | 5f934dbf5d577aa1c91ee697a06a67b0bb36dd23 /src/main/java/com/thatgravyboat/skyblockhud/tracker/TrackerHandler.java | |
parent | a2087e9a2fa43e13e4276b81ac7235f441a5c28d (diff) | |
download | skyhanni-c167f4e84e22da7b7c4405b5d59c817734654fc0.tar.gz skyhanni-c167f4e84e22da7b7c4405b5d59c817734654fc0.tar.bz2 skyhanni-c167f4e84e22da7b7c4405b5d59c817734654fc0.zip |
start with custom config
Diffstat (limited to 'src/main/java/com/thatgravyboat/skyblockhud/tracker/TrackerHandler.java')
-rw-r--r-- | src/main/java/com/thatgravyboat/skyblockhud/tracker/TrackerHandler.java | 74 |
1 files changed, 36 insertions, 38 deletions
diff --git a/src/main/java/com/thatgravyboat/skyblockhud/tracker/TrackerHandler.java b/src/main/java/com/thatgravyboat/skyblockhud/tracker/TrackerHandler.java index f8eaba306..da625a0a5 100644 --- a/src/main/java/com/thatgravyboat/skyblockhud/tracker/TrackerHandler.java +++ b/src/main/java/com/thatgravyboat/skyblockhud/tracker/TrackerHandler.java @@ -2,20 +2,18 @@ package com.thatgravyboat.skyblockhud.tracker; import com.thatgravyboat.skyblockhud.SkyblockHud; import com.thatgravyboat.skyblockhud.api.events.SkyBlockEntityKilled; -import com.thatgravyboat.skyblockhud.core.config.Position; import com.thatgravyboat.skyblockhud.location.LocationHandler; import com.thatgravyboat.skyblockhud.location.Locations; -import com.thatgravyboat.skyblockhud.utils.Utils; -import java.util.*; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.Gui; -import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.RenderHelper; import net.minecraft.client.renderer.entity.RenderItem; import net.minecraft.item.ItemStack; import net.minecraftforge.client.event.RenderGameOverlayEvent; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import java.util.*; + public class TrackerHandler extends Gui { public static Set<TrackerObject> trackerObjects = new HashSet<>(); @@ -73,39 +71,39 @@ public class TrackerHandler extends Gui { @SubscribeEvent public void renderOverlay(RenderGameOverlayEvent.Post event) { - if (Utils.overlayShouldRender(event.type, SkyblockHud.hasSkyblockScoreboard(), trackers.containsKey(LocationHandler.getCurrentLocation()), !SkyblockHud.config.trackers.hideTracker)) { - Map<String, TrackerObject> tracker = trackers.get(LocationHandler.getCurrentLocation()); - Minecraft mc = Minecraft.getMinecraft(); - - if (tracker != null) { - Position pos = SkyblockHud.config.trackers.trackerPosition; - int startPos = pos.getAbsX(event.resolution, (tracker.size() >= 6 ? 130 : tracker.size() * 20)); - int y = pos.getAbsY(event.resolution, (int) (10 + Math.ceil(tracker.size() / 5d) * 20)); - - Gui.drawRect(startPos, y, startPos + 130, y + 10, -1072689136); - mc.fontRendererObj.drawString("Tracker", startPos + 4, y + 1, 0xffffff, false); - y += 10; - Gui.drawRect(startPos, y, startPos + (tracker.size() >= 6 ? 130 : (tracker.size() * 20) + 10), (int) (y + (Math.ceil(tracker.size() / 5d) * 20)), 1610612736); - int x = startPos + 5; - for (TrackerObject object : tracker.values()) { - String s = Utils.formattedNumber(object.getCount(), 1000); - GlStateManager.disableLighting(); - GlStateManager.enableDepth(); - drawItemStack(object.getDisplayStack(), x, y); - GlStateManager.disableDepth(); - GlStateManager.disableBlend(); - mc.fontRendererObj.drawStringWithShadow(s, (float) (x + 19 - 2 - mc.fontRendererObj.getStringWidth(s)), (float) (y + 9), object.getCount() < 1 ? 16733525 : 16777215); - GlStateManager.enableBlend(); - GlStateManager.enableDepth(); - - if ((x - startPos + 5) / 20 == 5) { - x = startPos + 5; - y += 20; - } else { - x += 20; - } - } - } - } +// if (Utils.overlayShouldRender(event.type, SkyblockHud.hasSkyblockScoreboard(), trackers.containsKey(LocationHandler.getCurrentLocation()), !SkyblockHud.config.trackers.hideTracker)) { +// Map<String, TrackerObject> tracker = trackers.get(LocationHandler.getCurrentLocation()); +// Minecraft mc = Minecraft.getMinecraft(); +// +// if (tracker != null) { +// Position pos = SkyblockHud.config.trackers.trackerPosition; +// int startPos = pos.getAbsX(event.resolution, (tracker.size() >= 6 ? 130 : tracker.size() * 20)); +// int y = pos.getAbsY(event.resolution, (int) (10 + Math.ceil(tracker.size() / 5d) * 20)); +// +// Gui.drawRect(startPos, y, startPos + 130, y + 10, -1072689136); +// mc.fontRendererObj.drawString("Tracker", startPos + 4, y + 1, 0xffffff, false); +// y += 10; +// Gui.drawRect(startPos, y, startPos + (tracker.size() >= 6 ? 130 : (tracker.size() * 20) + 10), (int) (y + (Math.ceil(tracker.size() / 5d) * 20)), 1610612736); +// int x = startPos + 5; +// for (TrackerObject object : tracker.values()) { +// String s = Utils.formattedNumber(object.getCount(), 1000); +// GlStateManager.disableLighting(); +// GlStateManager.enableDepth(); +// drawItemStack(object.getDisplayStack(), x, y); +// GlStateManager.disableDepth(); +// GlStateManager.disableBlend(); +// mc.fontRendererObj.drawStringWithShadow(s, (float) (x + 19 - 2 - mc.fontRendererObj.getStringWidth(s)), (float) (y + 9), object.getCount() < 1 ? 16733525 : 16777215); +// GlStateManager.enableBlend(); +// GlStateManager.enableDepth(); +// +// if ((x - startPos + 5) / 20 == 5) { +// x = startPos + 5; +// y += 20; +// } else { +// x += 20; +// } +// } +// } +// } } } |