aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/features/event
diff options
context:
space:
mode:
authorCalMWolfs <94038482+CalMWolfs@users.noreply.github.com>2024-06-07 22:10:11 +1000
committerGitHub <noreply@github.com>2024-06-07 14:10:11 +0200
commit79d0cd3af5b2acf11fc63bc3aa6743f784a3a0f6 (patch)
tree9a8507e4d7fe308dd4a228149f5a864301cfcce9 /src/main/java/at/hannibal2/skyhanni/features/event
parentcfb12e7e3bbaf820f9402c286cba6bb0a33671fa (diff)
downloadskyhanni-79d0cd3af5b2acf11fc63bc3aa6743f784a3a0f6.tar.gz
skyhanni-79d0cd3af5b2acf11fc63bc3aa6743f784a3a0f6.tar.bz2
skyhanni-79d0cd3af5b2acf11fc63bc3aa6743f784a3a0f6.zip
Backend: Change Java to Kotlin for repo files (#1543)
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features/event')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/event/diana/DianaProfitTracker.kt10
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/event/lobby/waypoints/EventWaypoint.kt4
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/event/lobby/waypoints/christmas/PresentWaypoints.kt5
3 files changed, 9 insertions, 10 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/event/diana/DianaProfitTracker.kt b/src/main/java/at/hannibal2/skyhanni/features/event/diana/DianaProfitTracker.kt
index 7dcf9ff7a..9fe716328 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/event/diana/DianaProfitTracker.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/event/diana/DianaProfitTracker.kt
@@ -1,7 +1,7 @@
package at.hannibal2.skyhanni.features.event.diana
import at.hannibal2.skyhanni.SkyHanniMod
-import at.hannibal2.skyhanni.data.jsonobjects.repo.DianaDrops
+import at.hannibal2.skyhanni.data.jsonobjects.repo.DianaDropsJson
import at.hannibal2.skyhanni.events.GuiRenderEvent
import at.hannibal2.skyhanni.events.ItemAddEvent
import at.hannibal2.skyhanni.events.LorenzChatEvent
@@ -54,12 +54,12 @@ object DianaProfitTracker {
@Expose
var burrowsDug: Long = 0
- override fun getDescription(timesDropped: Long): List<String> {
- val percentage = timesDropped.toDouble() / burrowsDug
+ override fun getDescription(timesGained: Long): List<String> {
+ val percentage = timesGained.toDouble() / burrowsDug
val perBurrow = LorenzUtils.formatPercentage(percentage.coerceAtMost(1.0))
return listOf(
- "§7Dropped §e${timesDropped.addSeparators()} §7times.",
+ "§7Dropped §e${timesGained.addSeparators()} §7times.",
"§7Your drop chance per burrow: §c$perBurrow",
)
}
@@ -148,7 +148,7 @@ object DianaProfitTracker {
@SubscribeEvent
fun onRepoReload(event: RepositoryReloadEvent) {
- allowedDrops = event.getConstant<DianaDrops>("DianaDrops").diana_drops
+ allowedDrops = event.getConstant<DianaDropsJson>("DianaDrops").dianaDrops
}
fun resetCommand() {
diff --git a/src/main/java/at/hannibal2/skyhanni/features/event/lobby/waypoints/EventWaypoint.kt b/src/main/java/at/hannibal2/skyhanni/features/event/lobby/waypoints/EventWaypoint.kt
index af2c17be0..411e08e5e 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/event/lobby/waypoints/EventWaypoint.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/event/lobby/waypoints/EventWaypoint.kt
@@ -1,6 +1,6 @@
package at.hannibal2.skyhanni.features.event.lobby.waypoints
-import at.hannibal2.skyhanni.data.jsonobjects.repo.EventWaypointsJson
+import at.hannibal2.skyhanni.data.jsonobjects.repo.EventWaypointData
import at.hannibal2.skyhanni.utils.LorenzVec
data class EventWaypoint(
@@ -9,7 +9,7 @@ data class EventWaypoint(
var isFound: Boolean = false,
)
-fun loadEventWaypoints(waypoints: Map<String, List<EventWaypointsJson.Waypoint>>): Map<String, MutableSet<EventWaypoint>> {
+fun loadEventWaypoints(waypoints: Map<String, List<EventWaypointData>>): Map<String, MutableSet<EventWaypoint>> {
return buildMap {
waypoints.forEach { lobby ->
val set = mutableSetOf<EventWaypoint>()
diff --git a/src/main/java/at/hannibal2/skyhanni/features/event/lobby/waypoints/christmas/PresentWaypoints.kt b/src/main/java/at/hannibal2/skyhanni/features/event/lobby/waypoints/christmas/PresentWaypoints.kt
index c76349cd1..b56adecad 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/event/lobby/waypoints/christmas/PresentWaypoints.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/event/lobby/waypoints/christmas/PresentWaypoints.kt
@@ -120,9 +120,8 @@ object PresentWaypoints {
@SubscribeEvent
fun onRepoReload(event: RepositoryReloadEvent) {
val data = event.getConstant<EventWaypointsJson>("EventWaypoints")
- presentLocations = loadEventWaypoints(data.presents ?: error("'presents' is null in EventWaypoints!"))
- presentEntranceLocations =
- loadEventWaypoints(data.presents_entrances ?: error("'presents_entrances' is null in EventWaypoints!"))
+ presentLocations = loadEventWaypoints(data.presents)
+ presentEntranceLocations = loadEventWaypoints(data.presentsEntrances)
}
private fun isEnabled(): Boolean =