aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/me/xmrvizzy/skyblocker/skyblock/tabhud/util
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/me/xmrvizzy/skyblocker/skyblock/tabhud/util')
-rw-r--r--src/main/java/me/xmrvizzy/skyblocker/skyblock/tabhud/util/Ico.java5
-rw-r--r--src/main/java/me/xmrvizzy/skyblocker/skyblock/tabhud/util/PlayerListMgr.java13
-rw-r--r--src/main/java/me/xmrvizzy/skyblocker/skyblock/tabhud/util/PlayerLocator.java3
3 files changed, 17 insertions, 4 deletions
diff --git a/src/main/java/me/xmrvizzy/skyblocker/skyblock/tabhud/util/Ico.java b/src/main/java/me/xmrvizzy/skyblocker/skyblock/tabhud/util/Ico.java
index ca767617..97237769 100644
--- a/src/main/java/me/xmrvizzy/skyblocker/skyblock/tabhud/util/Ico.java
+++ b/src/main/java/me/xmrvizzy/skyblocker/skyblock/tabhud/util/Ico.java
@@ -52,4 +52,9 @@ public class Ico {
public static final ItemStack SAPLING = new ItemStack(Items.OAK_SAPLING);
public static final ItemStack MILESTONE = new ItemStack(Items.LODESTONE);
public static final ItemStack PICKAXE = new ItemStack(Items.IRON_PICKAXE);
+ public static final ItemStack NETHER_STAR = new ItemStack(Items.NETHER_STAR);
+ public static final ItemStack HEART_OF_THE_SEA = new ItemStack(Items.HEART_OF_THE_SEA);
+ public static final ItemStack EXPERIENCE_BOTTLE = new ItemStack(Items.EXPERIENCE_BOTTLE);
+ public static final ItemStack PINK_DYE = new ItemStack(Items.PINK_DYE);
+ public static final ItemStack ENCHANTED_BOOK = new ItemStack(Items.ENCHANTED_BOOK);
}
diff --git a/src/main/java/me/xmrvizzy/skyblocker/skyblock/tabhud/util/PlayerListMgr.java b/src/main/java/me/xmrvizzy/skyblocker/skyblock/tabhud/util/PlayerListMgr.java
index 5ace64ea..ee4319dc 100644
--- a/src/main/java/me/xmrvizzy/skyblocker/skyblock/tabhud/util/PlayerListMgr.java
+++ b/src/main/java/me/xmrvizzy/skyblocker/skyblock/tabhud/util/PlayerListMgr.java
@@ -98,8 +98,8 @@ public class PlayerListMgr {
* @return the text or null, if the display name is null
*
* @implNote currently designed specifically for crimson isles faction quests
- * widget, might not work correctly without modification for other
- * stuff. you've been warned!
+ * widget and the rift widgets, might not work correctly without
+ * modification for other stuff. you've been warned!
*/
public static Text textAt(int idx) {
@@ -128,13 +128,18 @@ public class PlayerListMgr {
// Trim leading & trailing space - this can only be done at the start and end
// otherwise it'll produce malformed results
if (i == 0)
- textToAppend = StringUtils.removeStart(textToAppend, " ");
+ textToAppend = textToAppend.stripLeading();
if (i == size - 1)
- textToAppend = StringUtils.removeEnd(textToAppend, " ");
+ textToAppend = textToAppend.stripTrailing();
newText.append(Text.literal(textToAppend).setStyle(current.getStyle()));
}
+ // Avoid returning an empty component - Rift advertisements needed this
+ if (newText.getString().length() == 0) {
+ return null;
+ }
+
return newText;
}
diff --git a/src/main/java/me/xmrvizzy/skyblocker/skyblock/tabhud/util/PlayerLocator.java b/src/main/java/me/xmrvizzy/skyblocker/skyblock/tabhud/util/PlayerLocator.java
index d7abdfc2..c2f14d3c 100644
--- a/src/main/java/me/xmrvizzy/skyblocker/skyblock/tabhud/util/PlayerLocator.java
+++ b/src/main/java/me/xmrvizzy/skyblocker/skyblock/tabhud/util/PlayerLocator.java
@@ -25,6 +25,7 @@ public class PlayerLocator {
JERRY,
GARDEN,
INSTANCED,
+ THE_RIFT,
UNKNOWN
}
@@ -82,6 +83,8 @@ public class PlayerLocator {
return Location.GARDEN;
case "Instanced":
return Location.INSTANCED;
+ case "The Rift":
+ return Location.THE_RIFT;
default:
return Location.UNKNOWN;
}