aboutsummaryrefslogtreecommitdiff
path: root/src/main/java
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2024-05-03 12:07:28 +0200
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2024-05-03 12:07:28 +0200
commit8d338540f3293b03acdd74f40a6c84a3cbedbded (patch)
tree909340a5a8eb8e38781b4357761242d9aad0f69a /src/main/java
parent29b1129ec9a55878e41e574415d76781cfaefe0e (diff)
downloadskyhanni-8d338540f3293b03acdd74f40a6c84a3cbedbded.tar.gz
skyhanni-8d338540f3293b03acdd74f40a6c84a3cbedbded.tar.bz2
skyhanni-8d338540f3293b03acdd74f40a6c84a3cbedbded.zip
added toggle
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/features/event/HoppityEggsConfig.java6
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggsManager.kt22
2 files changed, 21 insertions, 7 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/event/HoppityEggsConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/event/HoppityEggsConfig.java
index 5306cf967..e56633f42 100644
--- a/src/main/java/at/hannibal2/skyhanni/config/features/event/HoppityEggsConfig.java
+++ b/src/main/java/at/hannibal2/skyhanni/config/features/event/HoppityEggsConfig.java
@@ -42,4 +42,10 @@ public class HoppityEggsConfig {
@ConfigEditorBoolean
@FeatureToggle
public boolean highlightHoppityShop = true;
+
+ @Expose
+ @ConfigOption(name = "Time im Chat", desc = "Show in chat when using Egglocator that show next hoppity event or next egg time.")
+ @ConfigEditorBoolean
+ @FeatureToggle
+ public boolean timeInChat = true;
}
diff --git a/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggsManager.kt b/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggsManager.kt
index 1702a9667..25160cf51 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggsManager.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggsManager.kt
@@ -70,15 +70,21 @@ object HoppityEggsManager {
noEggsLeftPattern.matchMatcher(event.message) {
HoppityEggType.allFound()
- val nextEgg = HoppityEggType.entries.minByOrNull { it.timeUntil() } ?: return
- event.chatComponent.appendText("\n§eNext egg available in §b${nextEgg.timeUntil().format()}")
+ if (config.timeInChat) {
+ val nextEgg = HoppityEggType.entries.minByOrNull { it.timeUntil() } ?: return
+ ChatUtils.chat("§eNext egg available in §b${nextEgg.timeUntil().format()}")
+ event.blockedReason = "hoppity_egg"
+ }
return
}
eggAlreadyCollectedPattern.matchMatcher(event.message) {
getEggType(event).markClaimed()
- val nextEgg = HoppityEggType.entries.minByOrNull { it.timeUntil() } ?: return
- event.chatComponent.appendText("\n§eNext egg available in §b${nextEgg.timeUntil().format()}")
+ if (config.timeInChat) {
+ val nextEgg = HoppityEggType.entries.minByOrNull { it.timeUntil() } ?: return
+ ChatUtils.chat("§eNext egg available in §b${nextEgg.timeUntil().format()}")
+ event.blockedReason = "hoppity_egg"
+ }
return
}
@@ -89,9 +95,12 @@ object HoppityEggsManager {
hoppityEventNotOn.matchMatcher(event.message) {
val currentYear = SkyBlockTime.now().year
- val timeUntil = SkyBlockTime(currentYear + 1).asTimeMark().timeUntil()
- event.chatComponent.appendText("\n§eNext Hoppity's Hunt in §b${timeUntil.format()}")
+ if (config.timeInChat) {
+ val timeUntil = SkyBlockTime(currentYear + 1).asTimeMark().timeUntil()
+ ChatUtils.chat("§eHoppity's Hunt not active. Next Hoppity's Hunt event in §b${timeUntil.format()}")
+ event.blockedReason = "hoppity_egg"
+ }
return
}
}
@@ -150,5 +159,4 @@ object HoppityEggsManager {
event.move(44, "event.chocolateFactory.hoppityEggs", "event.hoppityEggs")
}
-
}