From a6148c72d4d53c916a73de979519109a378f2451 Mon Sep 17 00:00:00 2001 From: Rime <81419447+Emirlol@users.noreply.github.com> Date: Tue, 28 May 2024 19:28:52 +0300 Subject: Refactor line smoothener --- .../skyblock/item/tooltip/ItemTooltip.java | 20 -------------------- 1 file changed, 20 deletions(-) (limited to 'src/main/java/de/hysky/skyblocker/skyblock/item/tooltip') diff --git a/src/main/java/de/hysky/skyblocker/skyblock/item/tooltip/ItemTooltip.java b/src/main/java/de/hysky/skyblocker/skyblock/item/tooltip/ItemTooltip.java index 031817ac..505c4c8b 100644 --- a/src/main/java/de/hysky/skyblocker/skyblock/item/tooltip/ItemTooltip.java +++ b/src/main/java/de/hysky/skyblocker/skyblock/item/tooltip/ItemTooltip.java @@ -22,7 +22,6 @@ import net.minecraft.nbt.NbtElement; import net.minecraft.text.MutableText; import net.minecraft.text.Text; import net.minecraft.util.Formatting; - import org.jetbrains.annotations.NotNull; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -39,8 +38,6 @@ public class ItemTooltip { public static void getTooltip(ItemStack stack, Item.TooltipContext tooltipContext, TooltipType tooltipType, List lines) { if (!Utils.isOnSkyblock() || client.player == null) return; - smoothenLines(lines); - String name = getInternalNameFromNBT(stack, false); String internalID = getInternalNameFromNBT(stack, true); String neuName = name; @@ -394,23 +391,6 @@ public class ItemTooltip { return message; } - //This is static to not create a new text object for each line in every item - private static final Text BUMPY_LINE = Text.literal("-----------------").formatted(Formatting.DARK_GRAY, Formatting.STRIKETHROUGH); - - private static void smoothenLines(List lines) { - for (int i = 0; i < lines.size(); i++) { - List lineSiblings = lines.get(i).getSiblings(); - //Compare the first sibling rather than the whole object as the style of the root object can change while visually staying the same - if (lineSiblings.size() == 1 && lineSiblings.getFirst().equals(BUMPY_LINE)) { - lines.set(i, createSmoothLine()); - } - } - } - - public static Text createSmoothLine() { - return 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; -- cgit