aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/fishing/SharkFishCounter.kt22
1 files changed, 21 insertions, 1 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/fishing/SharkFishCounter.kt b/src/main/java/at/hannibal2/skyhanni/features/fishing/SharkFishCounter.kt
index 30f95f3e3..4d4ec4455 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/fishing/SharkFishCounter.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/fishing/SharkFishCounter.kt
@@ -2,11 +2,13 @@ package at.hannibal2.skyhanni.features.fishing
import at.hannibal2.skyhanni.SkyHanniMod
import at.hannibal2.skyhanni.events.GuiRenderEvent
+import at.hannibal2.skyhanni.events.LorenzChatEvent
import at.hannibal2.skyhanni.events.SeaCreatureFishEvent
import at.hannibal2.skyhanni.utils.InventoryUtils
import at.hannibal2.skyhanni.utils.ItemUtils.getLore
import at.hannibal2.skyhanni.utils.ItemUtils.name
import at.hannibal2.skyhanni.utils.LorenzUtils
+import at.hannibal2.skyhanni.utils.NumberUtil.addSeparators
import at.hannibal2.skyhanni.utils.RenderUtils.renderString
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
import net.minecraftforge.fml.common.gameevent.TickEvent
@@ -24,7 +26,7 @@ class SharkFishCounter {
val displayName = event.seaCreature.displayName
if (displayName.contains("Shark")) {
counter++
- display = "$counter sharks caught"
+ display = "§7Sharks caught: §e${counter.addSeparators()}"
}
}
@@ -42,6 +44,24 @@ class SharkFishCounter {
}
}
+ @SubscribeEvent
+ fun onChatMessage(event: LorenzChatEvent) {
+ if (event.message == "§b§lFISHING FESTIVAL §r§eThe festival has concluded! Time to dry off and repair your rods!") {
+ val funnyComment = when {
+ counter == 0 -> return
+ counter < 50 -> "Well done!"
+ counter < 100 -> "Nice!"
+ counter < 150 -> "Really nice!"
+ counter < 200 -> "Super cool!"
+ counter < 250 -> "Mega cool!"
+ counter < 350 -> "Like a pro!"
+ else -> "How???"
+ }
+ LorenzUtils.chat("§e[SkyHanni] You caught ${counter.addSeparators()} sharks during this fishing contest. $funnyComment")
+ counter = 0
+ }
+ }
+
private fun isWaterFishingRod(): Boolean {
val heldItem = InventoryUtils.getItemInHand() ?: return false
val isRod = heldItem.name?.contains("Rod") ?: return false