aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-06-05 00:31:48 +0200
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-06-05 00:31:48 +0200
commitaba6e109e9a2c008ee23a7605e20839422c7d61e (patch)
treea2b625cb7e1052977b75d05708fb632efc53d19a /src/main
parentfd248c963a4d08be55817cfc7683547f54f399f2 (diff)
downloadskyhanni-aba6e109e9a2c008ee23a7605e20839422c7d61e.tar.gz
skyhanni-aba6e109e9a2c008ee23a7605e20839422c7d61e.tar.bz2
skyhanni-aba6e109e9a2c008ee23a7605e20839422c7d61e.zip
Fixed formatting, added inSkyBlock check and used more clear wording in the config
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/features/Misc.java6
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/misc/PocketSackInASackDisplay.kt13
2 files changed, 10 insertions, 9 deletions
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"))
}
}
}