aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/dulkirmod/features
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/kotlin/dulkirmod/features')
-rw-r--r--src/main/kotlin/dulkirmod/features/AlarmClock.kt14
-rw-r--r--src/main/kotlin/dulkirmod/features/Croesus.kt32
-rw-r--r--src/main/kotlin/dulkirmod/features/DungeonLeap.kt32
3 files changed, 66 insertions, 12 deletions
diff --git a/src/main/kotlin/dulkirmod/features/AlarmClock.kt b/src/main/kotlin/dulkirmod/features/AlarmClock.kt
index 8dd0a32..075f106 100644
--- a/src/main/kotlin/dulkirmod/features/AlarmClock.kt
+++ b/src/main/kotlin/dulkirmod/features/AlarmClock.kt
@@ -3,9 +3,8 @@ package dulkirmod.features
import dulkirmod.DulkirMod
import dulkirmod.DulkirMod.Companion.mc
import dulkirmod.config.Config
+import dulkirmod.utils.ScoreBoardUtils
import dulkirmod.utils.Utils
-import net.minecraft.scoreboard.Score
-import net.minecraft.scoreboard.ScorePlayerTeam
var lastUpdate : Long = 0
@@ -14,16 +13,7 @@ fun alarmClock() {
if (!Utils.isInSkyblock()) return
// CHECK TIME
val currTime : Long = System.currentTimeMillis()
- val scoreboard = mc.thePlayer.worldScoreboard
- val sidebarObjective = scoreboard.getObjectiveInDisplaySlot(1)
- val scores: List<Score> = ArrayList(scoreboard.getSortedScores(sidebarObjective))
- val lines: MutableList<String> = ArrayList()
- for (i in scores.indices.reversed()) {
- val score = scores[i]
- val scoreplayerteam1 = scoreboard.getPlayersTeam(score.playerName)
- val line = ScorePlayerTeam.formatPlayerName(scoreplayerteam1, score.playerName)
- lines.add(line)
- }
+ val lines = ScoreBoardUtils.getLines()
for (l in lines) {
// ZOMBIE VILLAGER
if (Config.notifyZombieVillager && l.contains("8:00pm") && (currTime - lastUpdate) > 15000) {
diff --git a/src/main/kotlin/dulkirmod/features/Croesus.kt b/src/main/kotlin/dulkirmod/features/Croesus.kt
new file mode 100644
index 0000000..0ddfe9e
--- /dev/null
+++ b/src/main/kotlin/dulkirmod/features/Croesus.kt
@@ -0,0 +1,32 @@
+package dulkirmod.features
+
+import dulkirmod.DulkirMod.Companion.mc
+import dulkirmod.config.Config
+import net.minecraft.client.gui.inventory.GuiChest
+import net.minecraft.inventory.ContainerChest
+import net.minecraft.inventory.Slot
+
+class Croesus {
+ companion object {
+ var currentlyOpenChestName = ""
+
+ fun inCroesus(): Boolean {
+ if (mc.currentScreen == null || !(mc.currentScreen is GuiChest)) return false
+ val chest = mc.currentScreen as GuiChest
+ val container = chest.inventorySlots as ContainerChest
+ currentlyOpenChestName = container.lowerChestInventory.displayName.unformattedText
+ if (currentlyOpenChestName == "Croesus") return true
+ return false
+ }
+
+ fun isChestOpened(slotIn: Slot): Boolean {
+ if (!Config.hideOpenedChests) return false
+ if (slotIn.stack?.getTooltip(mc.thePlayer, false) == null) return false
+
+ var tooltip = slotIn.stack.getTooltip(mc.thePlayer, false)
+ if (tooltip.contains("§5§o§aChests have been opened!")) return true
+
+ return false
+ }
+ }
+} \ No newline at end of file
diff --git a/src/main/kotlin/dulkirmod/features/DungeonLeap.kt b/src/main/kotlin/dulkirmod/features/DungeonLeap.kt
new file mode 100644
index 0000000..54a304c
--- /dev/null
+++ b/src/main/kotlin/dulkirmod/features/DungeonLeap.kt
@@ -0,0 +1,32 @@
+package dulkirmod.features
+
+import dulkirmod.DulkirMod
+import dulkirmod.config.Config
+import dulkirmod.utils.Utils
+import net.minecraft.client.gui.inventory.GuiChest
+import net.minecraft.inventory.ContainerChest
+import net.minecraft.inventory.Slot
+
+class DungeonLeap {
+ companion object {
+ fun inLeapMenu(): Boolean {
+ if (DulkirMod.mc.currentScreen == null || !(DulkirMod.mc.currentScreen is GuiChest)) return false
+ val chest = DulkirMod.mc.currentScreen as GuiChest
+ val container = chest.inventorySlots as ContainerChest
+ Croesus.currentlyOpenChestName = container.lowerChestInventory.displayName.unformattedText
+ if (Croesus.currentlyOpenChestName == "Spirit Leap") return true
+ return false
+ }
+
+ fun isHighlightedLeapPlayer(slotIn: Slot): Boolean {
+ if (slotIn.stack?.getTooltip(DulkirMod.mc.thePlayer, false) == null) return false
+
+ val tooltip = slotIn.stack.getTooltip(DulkirMod.mc.thePlayer, false)
+ for (s in tooltip) {
+ var t = Utils.stripColorCodes(s)
+ if (t == Config.highlightLeapName) return true
+ }
+ return false
+ }
+ }
+} \ No newline at end of file