From 79d0cd3af5b2acf11fc63bc3aa6743f784a3a0f6 Mon Sep 17 00:00:00 2001 From: CalMWolfs <94038482+CalMWolfs@users.noreply.github.com> Date: Fri, 7 Jun 2024 22:10:11 +1000 Subject: Backend: Change Java to Kotlin for repo files (#1543) --- .../skyhanni/features/event/diana/DianaProfitTracker.kt | 10 +++++----- .../skyhanni/features/event/lobby/waypoints/EventWaypoint.kt | 4 ++-- .../event/lobby/waypoints/christmas/PresentWaypoints.kt | 5 ++--- 3 files changed, 9 insertions(+), 10 deletions(-) (limited to 'src/main/java/at/hannibal2/skyhanni/features/event') 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 { - val percentage = timesDropped.toDouble() / burrowsDug + override fun getDescription(timesGained: Long): List { + 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").diana_drops + allowedDrops = event.getConstant("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>): Map> { +fun loadEventWaypoints(waypoints: Map>): Map> { return buildMap { waypoints.forEach { lobby -> val set = mutableSetOf() 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("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 = -- cgit