aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/features/garden
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-03-23 15:14:03 +0100
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-03-23 15:14:03 +0100
commitd341829214683e1dfb9009da1120f3dae290a8f1 (patch)
tree5599eb52a673c7eda7016c287a00bc50c943eee0 /src/main/java/at/hannibal2/skyhanni/features/garden
parentfc824ace3d40a6392f05f626887d7bfe80c04eb9 (diff)
downloadskyhanni-d341829214683e1dfb9009da1120f3dae290a8f1.tar.gz
skyhanni-d341829214683e1dfb9009da1120f3dae290a8f1.tar.bz2
skyhanni-d341829214683e1dfb9009da1120f3dae290a8f1.zip
Added LorenzUtils.getPlayerUuid
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features/garden')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/EliteFarmingWeight.kt12
1 files changed, 2 insertions, 10 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/EliteFarmingWeight.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/EliteFarmingWeight.kt
index 2c21a10a5..4eac3e0bb 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/garden/EliteFarmingWeight.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/garden/EliteFarmingWeight.kt
@@ -13,7 +13,6 @@ import at.hannibal2.skyhanni.utils.TimeUtils
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch
import kotlinx.coroutines.withContext
-import net.minecraft.client.Minecraft
import net.minecraftforge.event.world.WorldEvent
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
import net.minecraftforge.fml.common.gameevent.TickEvent
@@ -208,7 +207,7 @@ class EliteFarmingWeight {
}
private suspend fun loadLeaderboardPosition() = try {
- val uuid = Minecraft.getMinecraft().thePlayer.uniqueID.toString().replace("-", "")
+ val uuid = LorenzUtils.getPlayerUuid()
val showNext = if (isEtaEnabled()) "?showNext=true" else ""
val url = "https://elitebot.dev/api/leaderboard/rank/weight/farming/$uuid/$profileId$showNext"
val result = withContext(Dispatchers.IO) { APIUtil.getJSONResponse(url) }.asJsonObject
@@ -228,15 +227,8 @@ class EliteFarmingWeight {
-1
}
- private fun UUID.uuidToString(): String {
- return "$this"
- }
-
private suspend fun loadWeight(localProfile: String) {
- val thePlayer = Minecraft.getMinecraft().thePlayer
- val uniqueID = thePlayer.uniqueID
- val abc = uniqueID.uuidToString()
- val uuid = abc.replace("-", "")
+ val uuid = LorenzUtils.getPlayerUuid()
val url = "https://elitebot.dev/api/weight/$uuid"
try {