diff options
author | inglettronald <71849533+inglettronald@users.noreply.github.com> | 2022-11-04 01:00:10 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-04 01:00:10 -0500 |
commit | c8dd376ff027606aab980a7da4049be61368a86c (patch) | |
tree | 323ee312f129b61a6de6e154c4bab6dd2cba820b /src/main/kotlin/dulkirmod/features/DungeonLeap.kt | |
parent | 91ee32e41b3e1be0959c879ba8f93876fbfaf9af (diff) | |
parent | 633c11c642b331e3a54060f06188bff35dab20d7 (diff) | |
download | DulkirMod-c8dd376ff027606aab980a7da4049be61368a86c.tar.gz DulkirMod-c8dd376ff027606aab980a7da4049be61368a86c.tar.bz2 DulkirMod-c8dd376ff027606aab980a7da4049be61368a86c.zip |
Merge pull request #2 from hannibal002/kotlin_reformat
Kotlin Reformat
Diffstat (limited to 'src/main/kotlin/dulkirmod/features/DungeonLeap.kt')
-rw-r--r-- | src/main/kotlin/dulkirmod/features/DungeonLeap.kt | 14 |
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] |