diff options
| author | msg-programs <msgdoesstuff@gmail.com> | 2023-05-19 17:05:00 +0200 |
|---|---|---|
| committer | msg-programs <msgdoesstuff@gmail.com> | 2023-05-19 17:05:00 +0200 |
| commit | 73968e490b4a6886b05f45a95bfcd2328affdac4 (patch) | |
| tree | a2380f147cb6d3d2d8128a04af9923faf15dce26 /src/main/java/me/xmrvizzy/skyblocker/skyblock/tabhud/widget | |
| parent | 981f8d4395a0870fc60fed216005e2a224225047 (diff) | |
| download | Skyblocker-73968e490b4a6886b05f45a95bfcd2328affdac4.tar.gz Skyblocker-73968e490b4a6886b05f45a95bfcd2328affdac4.tar.bz2 Skyblocker-73968e490b4a6886b05f45a95bfcd2328affdac4.zip | |
Rework just about everything to gracefully handle unexpected inputs
Diffstat (limited to 'src/main/java/me/xmrvizzy/skyblocker/skyblock/tabhud/widget')
41 files changed, 553 insertions, 527 deletions
diff --git a/src/main/java/me/xmrvizzy/skyblocker/skyblock/tabhud/widget/CommsWidget.java b/src/main/java/me/xmrvizzy/skyblocker/skyblock/tabhud/widget/CommsWidget.java index e45865e4..de90cf30 100644 --- a/src/main/java/me/xmrvizzy/skyblocker/skyblock/tabhud/widget/CommsWidget.java +++ b/src/main/java/me/xmrvizzy/skyblocker/skyblock/tabhud/widget/CommsWidget.java @@ -6,11 +6,11 @@ import java.util.regex.Pattern; import me.xmrvizzy.skyblocker.skyblock.dwarven.DwarvenHud.Commission; import me.xmrvizzy.skyblocker.skyblock.tabhud.util.Ico; -import me.xmrvizzy.skyblocker.skyblock.tabhud.util.StrMan; +import me.xmrvizzy.skyblocker.skyblock.tabhud.util.PlayerListMgr; import me.xmrvizzy.skyblocker.skyblock.tabhud.widget.component.Component; +import me.xmrvizzy.skyblocker.skyblock.tabhud.widget.component.IcoTextComponent; import me.xmrvizzy.skyblocker.skyblock.tabhud.widget.component.PlainTextComponent; import me.xmrvizzy.skyblocker.skyblock.tabhud.widget.component.ProgressComponent; -import net.minecraft.client.network.PlayerListEntry; import net.minecraft.text.MutableText; import net.minecraft.text.Text; import net.minecraft.util.Formatting; @@ -27,23 +27,31 @@ public class CommsWidget extends Widget { // match a comm // group 1: comm name // group 2: comm progress (without "%" for comms that show a percentage) - private static final Pattern COMM_PATTERN = Pattern.compile(" (.*): (.*)%?"); + private static final Pattern COMM_PATTERN = Pattern.compile("(?<name>.*): (?<progress>.*)%?"); - public CommsWidget(List<PlayerListEntry> list) { + public CommsWidget() { super(TITLE, Formatting.DARK_AQUA.getColorValue()); for (int i = 50; i <= 53; i++) { - Matcher m = StrMan.regexAt(list, i, COMM_PATTERN); + Matcher m = PlayerListMgr.regexAt(i, COMM_PATTERN); + // end of comms found? if (m == null) { + if (i == 50) { + this.addComponent(new IcoTextComponent()); + } break; } - String g2 = m.group(2); + ProgressComponent pc; - if (g2.equals("DONE")) { - pc = new ProgressComponent(Ico.BOOK, Text.of(m.group(1)), Text.of(g2), 100f, pcntToCol(100)); + + String name = m.group("name"); + String progress = m.group("progress"); + + if (progress.equals("DONE")) { + pc = new ProgressComponent(Ico.BOOK, Text.of(name), Text.of(progress), 100f, pcntToCol(100)); } else { - float pcnt = Float.parseFloat(g2.substring(0, g2.length() - 1)); - pc = new ProgressComponent(Ico.BOOK, Text.of(m.group(1)), pcnt, pcntToCol(pcnt)); + float pcnt = Float.parseFloat(progress.substring(0, progress.length() - 1)); + pc = new ProgressComponent(Ico.BOOK, Text.of(name), pcnt, pcntToCol(pcnt)); } this.addComponent(pc); } diff --git a/src/main/java/me/xmrvizzy/skyblocker/skyblock/tabhud/widget/ComposterWidget.java b/src/main/java/me/xmrvizzy/skyblocker/skyblock/tabhud/widget/ComposterWidget.java index 2537b90a..5922fcbc 100644 --- a/src/main/java/me/xmrvizzy/skyblocker/skyblock/tabhud/widget/ComposterWidget.java +++ b/src/main/java/me/xmrvizzy/skyblocker/skyblock/tabhud/widget/ComposterWidget.java @@ -1,12 +1,8 @@ package me.xmrvizzy.skyblocker.skyblock.tabhud.widget; -import java.util.List; import me.xmrvizzy.skyblocker.skyblock.tabhud.util.Ico; -import me.xmrvizzy.skyblocker.skyblock.tabhud.util.StrMan; -import me.xmrvizzy.skyblocker.skyblock.tabhud.widget.component.IcoTextComponent; -import net.minecraft.client.network.PlayerListEntry; import net.minecraft.text.MutableText; import net.minecraft.text.Text; import net.minecraft.util.Formatting; @@ -18,25 +14,13 @@ public class ComposterWidget extends Widget { private static final MutableText TITLE = Text.literal("Composter").formatted(Formatting.GREEN, Formatting.BOLD); - - public ComposterWidget(List<PlayerListEntry> list) { + public ComposterWidget() { super(TITLE, Formatting.GREEN.getColorValue()); - Text matter = StrMan.stdEntry(list, 48, "Organic Matter:", Formatting.YELLOW); - IcoTextComponent mat = new IcoTextComponent(Ico.SAPLING, matter); - this.addComponent(mat); - - Text fuel = StrMan.stdEntry(list, 49, "Fuel:", Formatting.BLUE); - IcoTextComponent f = new IcoTextComponent(Ico.FURNACE, fuel); - this.addComponent(f); - - Text timeLeft = StrMan.stdEntry(list, 50, "Time Left:", Formatting.RED); - IcoTextComponent time = new IcoTextComponent(Ico.CLOCK, timeLeft); - this.addComponent(time); - - Text compost = StrMan.stdEntry(list, 51, "Stored Compost:", Formatting.DARK_GREEN); - IcoTextComponent comp = new IcoTextComponent(Ico.COMPOSTER, compost); - this.addComponent(comp); + this.addSimpleIcoText(Ico.SAPLING, "Organic Matter:", Formatting.YELLOW, 48); + this.addSimpleIcoText(Ico.FURNACE, "Fuel:", Formatting.BLUE, 49); + this.addSimpleIcoText(Ico.CLOCK, "Time Left:", Formatting.RED, 50); + this.addSimpleIcoText(Ico.COMPOSTER, "Stored Compost:", Formatting.DARK_GREEN, 51); this.pack(); } diff --git a/src/main/java/me/xmrvizzy/skyblocker/skyblock/tabhud/widget/CookieWidget.java b/src/main/java/me/xmrvizzy/skyblocker/skyblock/tabhud/widget/CookieWidget.java index 8974efa7..42298fcd 100644 --- a/src/main/java/me/xmrvizzy/skyblocker/skyblock/tabhud/widget/CookieWidget.java +++ b/src/main/java/me/xmrvizzy/skyblocker/skyblock/tabhud/widget/CookieWidget.java @@ -1,8 +1,10 @@ package me.xmrvizzy.skyblocker.skyblock.tabhud.widget; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + import me.xmrvizzy.skyblocker.skyblock.tabhud.util.Ico; import me.xmrvizzy.skyblocker.skyblock.tabhud.widget.component.IcoTextComponent; - import net.minecraft.text.MutableText; import net.minecraft.text.Text; import net.minecraft.util.Formatting; @@ -15,15 +17,23 @@ public class CookieWidget extends Widget { private static final MutableText TITLE = Text.literal("Cookie Info").formatted(Formatting.DARK_PURPLE, Formatting.BOLD); + private static final Pattern COOKIE_PATTERN = Pattern.compile(".*\\nCookie Buff\\n(?<buff>.*)\\n"); + public CookieWidget(String footertext) { super(TITLE, Formatting.DARK_PURPLE.getColorValue()); - String interesting = footertext.split("Cookie Buff")[1]; - String[] lines = interesting.split("\n"); - if (lines[1].startsWith("Not")) { + Matcher m = COOKIE_PATTERN.matcher(footertext); + if (!m.find() || m.group("buff") == null) { + this.addComponent(new IcoTextComponent()); + this.pack(); + return; + } + + String buff = m.group("buff"); + if (buff.startsWith("Not")) { this.addComponent(new IcoTextComponent(Ico.COOKIE, Text.of("Not active"))); } else { - Text cookie = Text.literal("Time Left: ").append(lines[1]); + Text cookie = Text.literal("Time Left: ").append(buff); this.addComponent(new IcoTextComponent(Ico.COOKIE, cookie)); } this.pack(); diff --git a/src/main/java/me/xmrvizzy/skyblocker/skyblock/tabhud/widget/DungeonDeathWidget.java b/src/main/java/me/xmrvizzy/skyblocker/skyblock/tabhud/widget/DungeonDeathWidget.java index 928d9f76..3e5d8d6a 100644 --- a/src/main/java/me/xmrvizzy/skyblocker/skyblock/tabhud/widget/DungeonDeathWidget.java +++ b/src/main/java/me/xmrvizzy/skyblocker/skyblock/tabhud/widget/DungeonDeathWidget.java @@ -1,14 +1,12 @@ package me.xmrvizzy.skyblocker.skyblock.tabhud.widget; -import java.util.List; import java.util.regex.Matcher; import java.util.regex.Pattern; import me.xmrvizzy.skyblocker.skyblock.tabhud.util.Ico; -import me.xmrvizzy.skyblocker.skyblock.tabhud.util.StrMan; +import me.xmrvizzy.skyblocker.skyblock.tabhud.util.PlayerListMgr; import me.xmrvizzy.skyblocker.skyblock.tabhud.widget.component.IcoTextComponent; -import net.minecraft.client.network.PlayerListEntry; import net.minecraft.text.MutableText; import net.minecraft.text.Text; import net.minecraft.util.Formatting; @@ -23,28 +21,24 @@ public class DungeonDeathWidget extends Widget { // match the deaths entry // group 1: amount of deaths - private static final Pattern DEATH_PATTERN = Pattern.compile("\\S*: \\((\\d+)\\).*"); + private static final Pattern DEATH_PATTERN = Pattern.compile("\\S*: \\((?<deathnum>\\d+)\\).*"); - public DungeonDeathWidget(List<PlayerListEntry> list) { + public DungeonDeathWidget() { super(TITLE, Formatting.DARK_PURPLE.getColorValue()); - Matcher m = StrMan.regexAt(list, 25, DEATH_PATTERN); - Formatting f = (m.group(1).equals("0")) ? Formatting.GREEN : Formatting.RED; - Text d = Text.literal("Deaths: ").append(Text.literal(m.group(1)).formatted(f)); - IcoTextComponent deaths = new IcoTextComponent(Ico.SKULL, d); - this.addComponent(deaths); - - Text dealt = StrMan.stdEntry(list, 26, "Damage Dealt:", Formatting.RED); - IcoTextComponent de = new IcoTextComponent(Ico.SWORD, dealt); - this.addComponent(de); - - Text heal = StrMan.stdEntry(list, 27, "Healing Done:", Formatting.RED); - IcoTextComponent he = new IcoTextComponent(Ico.POTION, heal); - this.addComponent(he); - - Text mile = StrMan.stdEntry(list, 28, "Milestone:", Formatting.YELLOW); - IcoTextComponent mi = new IcoTextComponent(Ico.NTAG, mile); - this.addComponent(mi); + Matcher m = PlayerListMgr.regexAt( 25, DEATH_PATTERN); + if (m == null) { + this.addComponent(new IcoTextComponent()); + } else { + Formatting f = (m.group("deathnum").equals("0")) ? Formatting.GREEN : Formatting.RED; + Text d = Text.literal("Deaths: ").append(Text.literal(m.group("deathnum")).formatted(f)); + IcoTextComponent deaths = new IcoTextComponent(Ico.SKULL, d); + this.addComponent(deaths); + } + + this.addSimpleIcoText(Ico.SWORD, "Damage Dealt:", Formatting.RED, 26); + this.addSimpleIcoText(Ico.POTION, "Healing Done:", Formatting.RED, 27); + this.addSimpleIcoText(Ico.NTAG, "Milestone:", Formatting.YELLOW, 28); this.pack(); diff --git a/src/main/java/me/xmrvizzy/skyblocker/skyblock/tabhud/widget/DungeonDownedWidget.java b/src/main/java/me/xmrvizzy/skyblocker/skyblock/tabhud/widget/DungeonDownedWidget.java index 36245a4e..35926d7d 100644 --- a/src/main/java/me/xmrvizzy/skyblocker/skyblock/tabhud/widget/DungeonDownedWidget.java +++ b/src/main/java/me/xmrvizzy/skyblocker/skyblock/tabhud/widget/DungeonDownedWidget.java @@ -1,12 +1,9 @@ package me.xmrvizzy.skyblocker.skyblock.tabhud.widget; -import java.util.List; - import me.xmrvizzy.skyblocker.skyblock.tabhud.util.Ico; -import me.xmrvizzy.skyblocker.skyblock.tabhud.util.StrMan; +import me.xmrvizzy.skyblocker.skyblock.tabhud.util.PlayerListMgr; import me.xmrvizzy.skyblocker.skyblock.tabhud.widget.component.IcoTextComponent; -import net.minecraft.client.network.PlayerListEntry; import net.minecraft.text.MutableText; import net.minecraft.text.Text; import net.minecraft.util.Formatting; @@ -19,23 +16,20 @@ public class DungeonDownedWidget extends Widget { private static final MutableText TITLE = Text.literal("Downed").formatted(Formatting.DARK_PURPLE, Formatting.BOLD); - public DungeonDownedWidget(List<PlayerListEntry> list) { + public DungeonDownedWidget() { super(TITLE, Formatting.DARK_PURPLE.getColorValue()); Formatting format = Formatting.RED; - if (StrMan.strAt(list, 21).endsWith("NONE")) { + String down = PlayerListMgr.strAt(21); + if (down != null && down.endsWith("NONE")) { format = Formatting.GRAY; } - Text downed = StrMan.stdEntry(list, 21, "Downed:", format); - IcoTextComponent down = new IcoTextComponent(Ico.SKULL, downed); - this.addComponent(down); - - Text time = StrMan.stdEntry(list, 22, "Time:", Formatting.GRAY); - IcoTextComponent t = new IcoTextComponent(Ico.CLOCK, time); - this.addComponent(t); + int idx = down.indexOf(": "); + Text downed = (down == null || idx== -1) ? null : Widget.simpleEntryText(down.substring(idx + 2), "Downed:", format); + IcoTextComponent d = new IcoTextComponent(Ico.SKULL, downed); + this.addComponent(d); - Text revive = StrMan.stdEntry(list, 23, "Revive:", Formatting.GRAY); - IcoTextComponent rev = new IcoTextComponent(Ico.POTION, revive); - this.addComponent(rev); + this.addSimpleIcoText(Ico.CLOCK, "Time:", Formatting.GRAY, 22); + this.addSimpleIcoText(Ico.POTION, "Revive:", Formatting.GRAY, 23); this.pack(); } diff --git a/src/main/java/me/xmrvizzy/skyblocker/skyblock/tabhud/widget/DungeonPlayerWidget.java b/src/main/java/me/xmrvizzy/skyblocker/skyblock/tabhud/widget/DungeonPlayerWidget.java index 7195e455..8f28a2c6 100644 --- a/src/main/java/me/xmrvizzy/skyblocker/skyblock/tabhud/widget/DungeonPlayerWidget.java +++ b/src/main/java/me/xmrvizzy/skyblocker/skyblock/tabhud/widget/DungeonPlayerWidget.java @@ -2,14 +2,12 @@ package me.xmrvizzy.skyblocker.skyblock.tabhud.widget; import java.util.ArrayList; import java.util.HashMap; -import java.util.List; import java.util.regex.Matcher; import java.util.regex.Pattern; import me.xmrvizzy.skyblocker.skyblock.tabhud.util.Ico; -import me.xmrvizzy.skyblocker.skyblock.tabhud.util.StrMan; +import me.xmrvizzy.skyblocker.skyblock.tabhud.util.PlayerListMgr; import me.xmrvizzy.skyblocker.skyblock.tabhud.widget.component.IcoTextComponent; -import net.minecraft.client.network.PlayerListEntry; import net.minecraft.item.ItemStack; import net.minecraft.text.MutableText; import net.minecraft.text.Text; @@ -28,7 +26,8 @@ public class DungeonPlayerWidget extends Widget { // group 3: level (or nothing, if pre dungeon start) // as a side effect, this regex keeps the iron man icon in the name // not sure if that should be - private static final Pattern PLAYER_PATTERN = Pattern.compile("\\[\\d*\\] (.*) \\((\\S*) ?([LXVI]*)\\)"); + private static final Pattern PLAYER_PATTERN = Pattern + .compile("\\[\\d*\\] (?<name>.*) \\((?<class>\\S*) ?(?<level>[LXVI]*)\\)"); private static final HashMap<String, ItemStack> ICOS = new HashMap<>(); private static final ArrayList<String> MSGS = new ArrayList<>(); @@ -42,45 +41,49 @@ public class DungeonPlayerWidget extends Widget { MSGS.add("PRESS A TO JOIN"); MSGS.add("Invite a friend!"); MSGS.add("But nobody came."); + MSGS.add("More is better!"); } // title needs to be changeable here - public DungeonPlayerWidget(List<PlayerListEntry> list, int player) { + public DungeonPlayerWidget(int player) { super(TITLE, Formatting.DARK_PURPLE.getColorValue()); int start = 1 + (player - 1) * 4; - if (list.get(start).getDisplayName().getString().length() < 2) { - this.addComponent( - new IcoTextComponent(Ico.SIGN, Text.literal(MSGS.get((int)(Math.random()*MSGS.size()))).formatted(Formatting.GRAY))); + if (PlayerListMgr.strAt(start) == null) { + int idx = player - 2; + IcoTextComponent noplayer = new IcoTextComponent(Ico.SIGN, + Text.literal(MSGS.get(idx)).formatted(Formatting.GRAY)); + this.addComponent(noplayer); + this.pack(); + return; + } + Matcher m = PlayerListMgr.regexAt(start, PLAYER_PATTERN); + if (m == null) { + this.addComponent(new IcoTextComponent()); + this.addComponent(new IcoTextComponent()); } else { - Matcher m = StrMan.regexAt(list, start, PLAYER_PATTERN); - Text name = Text.literal("Name: ").append(Text.literal(m.group(1)).formatted(Formatting.YELLOW)); + Text name = Text.literal("Name: ").append(Text.literal(m.group("name")).formatted(Formatting.YELLOW)); this.addComponent(new IcoTextComponent(Ico.PLAYER, name)); - String cl = m.group(2); + String cl = m.group("class"); Formatting clf = Formatting.GRAY; ItemStack cli = Ico.BARRIER; if (!cl.equals("EMPTY")) { cli = ICOS.get(cl); clf = Formatting.LIGHT_PURPLE; - cl += " " + m.group(3); + cl += " " + m.group("level"); } - Text class_ = Text.literal("Class: ").append(Text.literal(cl).formatted(clf)); - IcoTextComponent itclass = new IcoTextComponent(cli, class_); + Text clazz = Text.literal("Class: ").append(Text.literal(cl).formatted(clf)); + IcoTextComponent itclass = new IcoTextComponent(cli, clazz); this.addComponent(itclass); + } - Text ult = StrMan.stdEntry(list, start + 1, "Ult Cooldown:", Formatting.GOLD); - IcoTextComponent ul = new IcoTextComponent(Ico.CLOCK, ult); - this.addComponent(ul); - - Text revive = StrMan.stdEntry(list, start + 2, "Revives:", Formatting.DARK_PURPLE); - IcoTextComponent re = new IcoTextComponent(Ico.POTION, revive); - this.addComponent(re); + this.addSimpleIcoText(Ico.CLOCK, "Ult Cooldown:", Formatting.GOLD, start + 1); + this.addSimpleIcoText(Ico.POTION, "Revives:", Formatting.DARK_PURPLE, start + 2); - } this.pack(); } diff --git a/src/main/java/me/xmrvizzy/skyblocker/skyblock/tabhud/widget/DungeonPuzzleWidget.java b/src/main/java/me/xmrvizzy/skyblocker/skyblock/tabhud/widget/DungeonPuzzleWidget.java index 86d1f938..b689228d 100644 --- a/src/main/java/me/xmrvizzy/skyblocker/skyblock/tabhud/widget/DungeonPuzzleWidget.java +++ b/src/main/java/me/xmrvizzy/skyblocker/skyblock/tabhud/widget/DungeonPuzzleWidget.java @@ -1,14 +1,12 @@ package me.xmrvizzy.skyblocker.skyblock.tabhud.widget; -import java.util.List; import java.util.regex.Matcher; import java.util.regex.Pattern; import me.xmrvizzy.skyblocker.skyblock.tabhud.util.Ico; -import me.xmrvizzy.skyblocker.skyblock.tabhud.util.StrMan; +import me.xmrvizzy.skyblocker.skyblock.tabhud.util.PlayerListMgr; import me.xmrvizzy.skyblocker.skyblock.tabhud.widget.component.IcoTextComponent; -import net.minecraft.client.network.PlayerListEntry; import net.minecraft.text.MutableText; import net.minecraft.text.Text; import net.minecraft.util.Formatting; @@ -25,20 +23,22 @@ public class DungeonPuzzleWidget extends Widget { // group 2: status // " ?.*" to diescard the solver's name if present // the teleport maze has a trailing whitespace that messes with the regex - private static final Pattern PUZZLE_PATTERN = Pattern.compile(" (.*): \\[(.*)\\] ?.*"); + private static final Pattern PUZZLE_PATTERN = Pattern.compile("(?<name>.*): \\[(?<status>.*)\\] ?.*"); - public DungeonPuzzleWidget(List<PlayerListEntry> list) { + public DungeonPuzzleWidget() { super(TITLE, Formatting.DARK_PURPLE.getColorValue()); int pos = 48; while (pos < 60) { - Matcher m = StrMan.regexAt(list, pos, PUZZLE_PATTERN); + Matcher m = PlayerListMgr.regexAt(pos, PUZZLE_PATTERN); if (m == null) { break; } - Text t = Text.literal(m.group(1) + ": ").append(Text.literal("[").formatted(Formatting.GRAY)) - .append(m.group(2)).append(Text.literal("]").formatted(Formatting.GRAY)); + Text t = Text.literal(m.group("name") + ": ") + .append(Text.literal("[").formatted(Formatting.GRAY)) + .append(m.group("status")) + .append(Text.literal("]").formatted(Formatting.GRAY)); IcoTextComponent itc = new IcoTextComponent(Ico.SIGN, t); this.addComponent(itc); pos++; @@ -46,6 +46,10 @@ public class DungeonPuzzleWidget extends Widget { // not sure which one is which // still need to find out codepoint for the puzzle failed char } + if (pos == 48) { + this.addComponent( + new IcoTextComponent(Ico.BARRIER, Text.literal("No puzzles!").formatted(Formatting.GRAY))); + } this.pack(); } diff --git a/src/main/java/me/xmrvizzy/skyblocker/skyblock/tabhud/widget/DungeonSecretWidget.java b/src/main/java/me/xmrvizzy/skyblocker/skyblock/tabhud/widget/DungeonSecretWidget.java index e0c83a35..2c760dad 100644 --- a/src/main/java/me/xmrvizzy/skyblocker/skyblock/tabhud/widget/DungeonSecretWidget.java +++ b/src/main/java/me/xmrvizzy/skyblocker/skyblock/tabhud/widget/DungeonSecretWidget.java @@ -1,12 +1,7 @@ package me.xmrvizzy.skyblocker.skyblock.tabhud.widget; -import java.util.List; - import me.xmrvizzy.skyblocker.skyblock.tabhud.util.Ico; -import me.xmrvizzy.skyblocker.skyblock.tabhud.util.StrMan; -import me.xmrvizzy.skyblocker.skyblock.tabhud.widget.component.IcoTextComponent; -import net.minecraft.client.network.PlayerListEntry; import net.minecraft.text.MutableText; import net.minecraft.text.Text; import net.minecraft.util.Formatting; @@ -18,16 +13,11 @@ public class DungeonSecretWidget extends Widget { private static final MutableText TITLE = Text.literal("Discoveries").formatted(Formatting.DARK_PURPLE, Formatting.BOLD); - public DungeonSecretWidget(List<PlayerListEntry> list) { + public DungeonSecretWidget() { super(TITLE, Formatting.DARK_PURPLE.getColorValue()); - Text secrets = StrMan.stdEntry(list, 31, "Secrets:", Formatting.YELLOW); - IcoTextComponent sec = new IcoTextComponent(Ico.CHEST, secrets); - this.addComponent(sec); - - Text crypts = StrMan.stdEntry(list, 32, "Crypts:", Formatting.YELLOW); - IcoTextComponent cry = new IcoTextComponent(Ico.SKULL, crypts); - this.addComponent(cry); + this.addSimpleIcoText(Ico.CHEST, "Secrets:", Formatting.YELLOW, 31); + this.addSimpleIcoText(Ico.SKULL, "Crypts:", Formatting.YELLOW, 32); this.pack(); } diff --git a/src/main/java/me/xmrvizzy/skyblocker/skyblock/tabhud/widget/DungeonServerWidget.java b/src/main/java/me/xmrvizzy/skyblocker/skyblock/tabhud/widget/DungeonServerWidget.java index 89d3b1ca..8801df68 100644 --- a/< |
