From 4b765d176b23df052ebdad4b45c480ffe904e4de Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Tue, 1 Nov 2022 13:42:42 +0100 Subject: kotlin reformat --- src/main/kotlin/dulkirmod/features/DungeonLeap.kt | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'src/main/kotlin/dulkirmod/features/DungeonLeap.kt') 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] -- cgit