summaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/features
diff options
context:
space:
mode:
authorjani270 <69345714+jani270@users.noreply.github.com>2024-04-17 22:26:47 +0200
committerGitHub <noreply@github.com>2024-04-17 22:26:47 +0200
commitfdf5c89d272beb3a8c903de1bcdaa594ad2de3d9 (patch)
tree1dd67b7029a1e6c84141844a8c07692dfa364e46 /src/main/java/at/hannibal2/skyhanni/features
parent97b62dfaa115fb3a2b11c2520a57c06d56a83459 (diff)
downloadskyhanni-fdf5c89d272beb3a8c903de1bcdaa594ad2de3d9.tar.gz
skyhanni-fdf5c89d272beb3a8c903de1bcdaa594ad2de3d9.tar.bz2
skyhanni-fdf5c89d272beb3a8c903de1bcdaa594ad2de3d9.zip
Improvement: Patcher Coords Color and Duration (#1476)
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/misc/PatcherSendCoordinates.kt16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/PatcherSendCoordinates.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/PatcherSendCoordinates.kt
index 1467c983c..2357cdaee 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/misc/PatcherSendCoordinates.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/misc/PatcherSendCoordinates.kt
@@ -1,11 +1,13 @@
package at.hannibal2.skyhanni.features.misc
import at.hannibal2.skyhanni.SkyHanniMod
+import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator
import at.hannibal2.skyhanni.events.LorenzChatEvent
import at.hannibal2.skyhanni.events.LorenzRenderWorldEvent
import at.hannibal2.skyhanni.events.LorenzTickEvent
import at.hannibal2.skyhanni.events.LorenzWorldChangeEvent
import at.hannibal2.skyhanni.test.GriffinUtils.drawWaypointFilled
+import at.hannibal2.skyhanni.utils.ColorUtils.toChromaColor
import at.hannibal2.skyhanni.utils.LocationUtils
import at.hannibal2.skyhanni.utils.LorenzColor
import at.hannibal2.skyhanni.utils.LorenzLogger
@@ -20,6 +22,7 @@ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
class PatcherSendCoordinates {
+ private val config get() = SkyHanniMod.feature.misc.patcherCoordsWaypoint
private val patcherBeacon = mutableListOf<PatcherBeacon>()
private val logger = LorenzLogger("misc/patchercoords")
@@ -30,7 +33,7 @@ class PatcherSendCoordinates {
@SubscribeEvent
fun onChat(event: LorenzChatEvent) {
- if (!SkyHanniMod.feature.misc.patcherSendCoordWaypoint) return
+ if (!config.enabled) return
val message = event.message.removeColor()
coordinatePattern.matchMatcher(message) {
@@ -53,12 +56,12 @@ class PatcherSendCoordinates {
@SubscribeEvent(priority = EventPriority.HIGH)
fun onWorldRender(event: LorenzRenderWorldEvent) {
- if (!SkyHanniMod.feature.misc.patcherSendCoordWaypoint) return
+ if (!config.enabled) return
for (beacon in patcherBeacon) {
val location = beacon.location
event.drawColor(location, LorenzColor.DARK_GREEN, alpha = 1f)
- event.drawWaypointFilled(location, LorenzColor.GREEN.toColor(), true, true)
+ event.drawWaypointFilled(location, config.color.toChromaColor(), true, true)
event.drawString(location.add(0.5, 0.5, 0.5), beacon.name, true, LorenzColor.DARK_BLUE.toColor())
}
}
@@ -72,7 +75,7 @@ class PatcherSendCoordinates {
patcherBeacon.removeIf { System.currentTimeMillis() / 1000 > it.time + 5 && location.distanceIgnoreY(it.location) < 5 }
// removed patcher beacon after time!
- patcherBeacon.removeIf { System.currentTimeMillis() / 1000 > it.time + 60 }
+ patcherBeacon.removeIf { System.currentTimeMillis() / 1000 > it.time + config.duration }
}
@SubscribeEvent
@@ -82,4 +85,9 @@ class PatcherSendCoordinates {
}
data class PatcherBeacon(val location: LorenzVec, val name: String, val time: Long)
+
+ @SubscribeEvent
+ fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) {
+ event.move(39, "misc.patcherSendCoordWaypoint", "misc.patcherCoordsWaypoint.enabled")
+ }
}