aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/dulkirmod/utils/Utils.kt
diff options
context:
space:
mode:
authoringle <inglettronald@gmail.com>2022-10-03 23:51:37 -0500
committeringle <inglettronald@gmail.com>2022-10-04 04:41:36 -0500
commitcecfa8fd5773eee9e5e732ab816b69b77162387d (patch)
treea0b4aae7160f6562c261f098bfda3579cff6297f /src/main/kotlin/dulkirmod/utils/Utils.kt
parent2092d19741295699b49c9aeaee4993cc15797556 (diff)
downloadDulkirMod-cecfa8fd5773eee9e5e732ab816b69b77162387d.tar.gz
DulkirMod-cecfa8fd5773eee9e5e732ab816b69b77162387d.tar.bz2
DulkirMod-cecfa8fd5773eee9e5e732ab816b69b77162387d.zip
-Added bestiary stuff
Diffstat (limited to 'src/main/kotlin/dulkirmod/utils/Utils.kt')
-rw-r--r--src/main/kotlin/dulkirmod/utils/Utils.kt14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/main/kotlin/dulkirmod/utils/Utils.kt b/src/main/kotlin/dulkirmod/utils/Utils.kt
index c3caa26..95f714b 100644
--- a/src/main/kotlin/dulkirmod/utils/Utils.kt
+++ b/src/main/kotlin/dulkirmod/utils/Utils.kt
@@ -9,7 +9,6 @@ import java.awt.Toolkit
import java.awt.datatransfer.Clipboard
import java.awt.datatransfer.DataFlavor
import java.awt.datatransfer.StringSelection
-import java.lang.IllegalArgumentException
import java.util.*
object Utils {
@@ -54,4 +53,17 @@ object Utils {
}
mc.displayGuiScreen(null)
}
+
+ fun isInSkyblock() : Boolean{
+ if ((mc.theWorld != null) && (mc.thePlayer != null)) {
+ if (mc.isSingleplayer || mc.thePlayer.clientBrand == null ||
+ !mc.thePlayer.clientBrand.lowercase(Locale.getDefault()).contains("hypixel")) {
+ return false
+ }
+ if (mc.thePlayer.worldScoreboard.getObjectiveInDisplaySlot(1) == null)
+ return false;
+ return stripColorCodes(mc.thePlayer.worldScoreboard.getObjectiveInDisplaySlot(1).displayName).contains("SKYBLOCK")
+ }
+ return false
+ }
} \ No newline at end of file