aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/data/TitleManager.kt6
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/fishing/SeaCreatureFeatures.kt5
-rw-r--r--src/main/java/at/hannibal2/skyhanni/utils/LorenzUtils.kt4
3 files changed, 7 insertions, 8 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/data/TitleManager.kt b/src/main/java/at/hannibal2/skyhanni/data/TitleManager.kt
index 3de2298a6..8cd45d76d 100644
--- a/src/main/java/at/hannibal2/skyhanni/data/TitleManager.kt
+++ b/src/main/java/at/hannibal2/skyhanni/data/TitleManager.kt
@@ -19,9 +19,9 @@ class TitleManager {
private var display = ""
private var endTime = SimpleTimeMark.farPast()
private var heightModifier = 1.8
- private var fontSizeModifier = 4.0
+ private var fontSizeModifier = 4f
- fun sendTitle(text: String, duration: Duration, height: Double = 1.8, fontSize: Double = 4.0) {
+ fun sendTitle(text: String, duration: Duration, height: Double, fontSize: Float) {
display = "§f$text"
endTime = SimpleTimeMark.now() + duration
heightModifier = height
@@ -36,7 +36,7 @@ class TitleManager {
val duration = args[0].toInt().seconds
val height = args[1].toDouble()
- val fontSize = args[2].toDouble()
+ val fontSize = args[2].toFloat()
val title = "§6" + args.drop(3).joinToString(" ").replace("&", "§")
sendTitle(title, duration, height, fontSize)
diff --git a/src/main/java/at/hannibal2/skyhanni/features/fishing/SeaCreatureFeatures.kt b/src/main/java/at/hannibal2/skyhanni/features/fishing/SeaCreatureFeatures.kt
index c02643a65..0d9bbb9c9 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/fishing/SeaCreatureFeatures.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/fishing/SeaCreatureFeatures.kt
@@ -2,7 +2,6 @@ package at.hannibal2.skyhanni.features.fishing
import at.hannibal2.skyhanni.SkyHanniMod
import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator
-import at.hannibal2.skyhanni.data.TitleManager
import at.hannibal2.skyhanni.events.EntityMaxHealthUpdateEvent
import at.hannibal2.skyhanni.events.LorenzWorldChangeEvent
import at.hannibal2.skyhanni.events.RenderEntityOutlineEvent
@@ -59,7 +58,7 @@ class SeaCreatureFeatures {
if (config.alertOtherCatches && lastRareCatch.passedSince() > 1.seconds) {
val creature = SeaCreatureManager.allFishingMobs[creatureType.nametag]
- TitleManager.sendTitle("${creature?.rarity?.chatColorCode ?: "§6"}RARE SEA CREATURE!", 1.5.seconds, 3.6, 7.0)
+ LorenzUtils.sendTitle("${creature?.rarity?.chatColorCode ?: "§6"}RARE SEA CREATURE!", 1.5.seconds, 3.6, 7f)
if (config.playSound) SoundUtils.playBeepSound()
}
}
@@ -71,7 +70,7 @@ class SeaCreatureFeatures {
if (!config.alertOwnCatches) return
if (event.seaCreature.rare) {
- TitleManager.sendTitle("${event.seaCreature.rarity.chatColorCode}RARE CATCH!", 3.seconds, 2.8, 7.0)
+ LorenzUtils.sendTitle("${event.seaCreature.rarity.chatColorCode}RARE CATCH!", 3.seconds, 2.8, 7f)
if (config.playSound) SoundUtils.playBeepSound()
lastRareCatch = SimpleTimeMark.now()
}
diff --git a/src/main/java/at/hannibal2/skyhanni/utils/LorenzUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/LorenzUtils.kt
index aa1b8e95d..f931e0f1d 100644
--- a/src/main/java/at/hannibal2/skyhanni/utils/LorenzUtils.kt
+++ b/src/main/java/at/hannibal2/skyhanni/utils/LorenzUtils.kt
@@ -639,8 +639,8 @@ object LorenzUtils {
fun <T> T.conditionalTransform(condition: Boolean, ifTrue: T.() -> Any, ifFalse: T.() -> Any) =
if (condition) ifTrue(this) else ifFalse(this)
- fun sendTitle(text: String, duration: Duration, height: Double = 1.8) {
- TitleManager.sendTitle(text, duration, height)
+ fun sendTitle(text: String, duration: Duration, height: Double = 1.8, fontSize: Float = 4f) {
+ TitleManager.sendTitle(text, duration, height, fontSize)
}
@Deprecated("Dont use this approach at all. check with regex or equals instead.", ReplaceWith("Regex or equals"))