aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/dulkirmod/features/DungeonLeap.kt
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2022-11-01 13:42:42 +0100
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2022-11-01 13:42:42 +0100
commit4b765d176b23df052ebdad4b45c480ffe904e4de (patch)
treef72cea5d2374a34423aad32fb12dc082147125e3 /src/main/kotlin/dulkirmod/features/DungeonLeap.kt
parent5ded107137a04fdbdfa718436a016af98cadd28e (diff)
downloadDulkirMod-4b765d176b23df052ebdad4b45c480ffe904e4de.tar.gz
DulkirMod-4b765d176b23df052ebdad4b45c480ffe904e4de.tar.bz2
DulkirMod-4b765d176b23df052ebdad4b45c480ffe904e4de.zip
kotlin reformat
Diffstat (limited to 'src/main/kotlin/dulkirmod/features/DungeonLeap.kt')
-rw-r--r--src/main/kotlin/dulkirmod/features/DungeonLeap.kt14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/main/kotlin/dulkirmod/features/DungeonLeap.kt b/src/main/kotlin/dulkirmod/features/DungeonLeap.kt
index b8ce75e..91e85f7 100644
--- a/src/main/kotlin/dulkirmod/features/DungeonLeap.kt
+++ b/src/main/kotlin/dulkirmod/features/DungeonLeap.kt
@@ -13,7 +13,8 @@ import net.minecraftforge.fml.common.gameevent.TickEvent
class DungeonLeap {
- private var lastGuiOpenEvent : Long = 0
+ private var lastGuiOpenEvent: Long = 0
+
@SubscribeEvent
fun onTick(event: TickEvent.ClientTickEvent) {
val lastInLeap = inLeapMenuBool
@@ -31,18 +32,19 @@ class DungeonLeap {
if (inLeapMenuBool && System.currentTimeMillis() - lastGuiOpenEvent < 300) {
for (i in 11..15) {
- boolArray[i-11] = false
+ boolArray[i - 11] = false
val slotIn = DulkirMod.mc.thePlayer.openContainer.getSlot(i)
if (slotIn.stack == null) continue
val stack = slotIn.stack
- if (Utils.stripColorCodes(stack.displayName) == Config.highlightLeapName) boolArray[i-11] = true
+ if (Utils.stripColorCodes(stack.displayName) == Config.highlightLeapName) boolArray[i - 11] = true
}
}
}
+
companion object {
- var inLeapMenuBool : Boolean = false
- var boolArray = BooleanArray(5) {false}
+ var inLeapMenuBool: Boolean = false
+ var boolArray = BooleanArray(5) { false }
fun inLeapMenu(): Boolean {
return inLeapMenuBool
@@ -50,7 +52,7 @@ class DungeonLeap {
fun isHighlightedLeapPlayer(slotIn: Slot): Boolean {
if (!inLeapMenuBool) return false
- if(slotIn.inventory == mc.thePlayer.inventory) return false
+ if (slotIn.inventory == mc.thePlayer.inventory) return false
val slotIndex = slotIn.slotIndex
if (slotIndex !in 11..15) return false
return boolArray[slotIndex - 11]