Skip to content

Commit

Permalink
Add line smoothener (#711)
Browse files Browse the repository at this point in the history
* Add line smoothener

* Update src/main/java/de/hysky/skyblocker/skyblock/item/tooltip/ItemTooltip.java
  • Loading branch information
Emirlol authored May 14, 2024
1 parent 9f09dbe commit cfff7e1
Showing 1 changed file with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ public class ItemTooltip {
public static void getTooltip(ItemStack stack, Item.TooltipContext tooltipContext, TooltipType tooltipType, List<Text> lines) {
if (!Utils.isOnSkyblock() || client.player == null) return;

smoothenLines(lines);

String name = getInternalNameFromNBT(stack, false);
String internalID = getInternalNameFromNBT(stack, true);
String neuName = name;
Expand Down Expand Up @@ -392,6 +394,15 @@ private static Text getMotesMessage(int price, int count) {
return message;
}

private static void smoothenLines(List<Text> lines) {
for (int i = 0; i < lines.size(); i++) {
Text line = lines.get(i);
if (line.getString().equals("-----------------")) {
lines.set(i, Text.literal(" ").formatted(Formatting.DARK_GRAY, Formatting.STRIKETHROUGH, Formatting.BOLD));
}
}
}

// If these options is true beforehand, the client will get first data of these options while loading.
// After then, it will only fetch the data if it is on Skyblock.
public static int minute = 0;
Expand Down

0 comments on commit cfff7e1

Please sign in to comment.