From aba6e109e9a2c008ee23a7605e20839422c7d61e Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Mon, 5 Jun 2023 00:31:48 +0200 Subject: Fixed formatting, added inSkyBlock check and used more clear wording in the config --- .../java/at/hannibal2/skyhanni/config/features/Misc.java | 6 +++--- .../skyhanni/features/misc/PocketSackInASackDisplay.kt | 13 +++++++------ 2 files changed, 10 insertions(+), 9 deletions(-) (limited to 'src/main') diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/Misc.java b/src/main/java/at/hannibal2/skyhanni/config/features/Misc.java index d55463419..73ef39593 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/Misc.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/Misc.java @@ -431,14 +431,14 @@ public class Misc { public static class PocketSackInASack { @Expose - @ConfigOption(name = "Pocket Sack-In-A-Sack", desc = "Show numbers of Pocket Sack-In-A-Sack applied on a sack.") + @ConfigOption(name = "Show in Overlay", desc = "Show numbers of Pocket Sack-In-A-Sack applied on a sack icon as overlay.") @ConfigEditorBoolean - public boolean showApplied = false; + public boolean showOverlay = false; @Expose @ConfigOption(name = "Replace In Lore", desc = "Replace how text is displayed in lore.\nShow §eis stitched with 2/3...\n§7Instead of §eis stitched with two...") @ConfigEditorBoolean - public boolean replaceLore = false; + public boolean replaceLore = true; } @Expose diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/PocketSackInASackDisplay.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/PocketSackInASackDisplay.kt index 5d851eb56..721248658 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/PocketSackInASackDisplay.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/PocketSackInASackDisplay.kt @@ -19,7 +19,7 @@ class PocketSackInASackDisplay { fun onRenderItemOverlayPost(event: GuiRenderItemEvent.RenderOverlayEvent.GuiRenderItemPost) { val stack = event.stack ?: return if (!LorenzUtils.inSkyBlock || stack.stackSize != 1) return - if (!config.showApplied) return + if (!config.showOverlay) return val pocketSackInASackApplied = stack.getAppliedPocketSackInASack() ?: return val stackTip = "§a$pocketSackInASackApplied" @@ -46,19 +46,20 @@ class PocketSackInASackDisplay { } @SubscribeEvent - fun onTooltip(event: LorenzToolTipEvent){ + fun onTooltip(event: LorenzToolTipEvent) { + if (!LorenzUtils.inSkyBlock) return if (!config.replaceLore) return if (!ItemUtils.isSack(event.itemStack.displayName)) return val it = event.toolTip.listIterator() - for (line in it){ - valPattern.matchMatcher(line){ - val replace = when (group("number")){ + for (line in it) { + valPattern.matchMatcher(line) { + val replace = when (group("number")) { "a" -> "§c1" "two" -> "§62" "three" -> "§a3" else -> "0" } - it.set(line.replace(Regex("\\b${group("number")}\\b"), "$replace§7/§b3")) + it.set(line.replace(Regex("\\b${group("number")}\\b"), "$replace§7/§b3")) } } } -- cgit