diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/minion/MinionFeatures.kt | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/minion/MinionFeatures.kt b/src/main/java/at/hannibal2/skyhanni/features/minion/MinionFeatures.kt index c06235daf..d876f2bb3 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/minion/MinionFeatures.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/minion/MinionFeatures.kt @@ -38,7 +38,6 @@ class MinionFeatures { private var minionInventoryOpen = false private var lastInventoryClosed = 0L - private var lastMinionPickedUp = 0L private var coinsPerDay = "" private val minionUpgradePattern = "§aYou have upgraded your Minion to Tier (?<tier>.*)".toPattern() @@ -123,7 +122,7 @@ class MinionFeatures { @SubscribeEvent fun onInventoryClose(event: InventoryCloseEvent) { if (!minionInventoryOpen) return - var minions = minions ?: return + val minions = minions ?: return minionInventoryOpen = false lastMinionOpened = System.currentTimeMillis() @@ -135,10 +134,6 @@ class MinionFeatures { if (location !in minions) { minions[location]!!.lastClicked = 0 } - - if (System.currentTimeMillis() - lastMinionPickedUp < 2_000) { - MinionFeatures.minions = minions.editCopy { remove(location) } - } } @SubscribeEvent @@ -210,7 +205,12 @@ class MinionFeatures { } if (message.startsWith("§aYou picked up a minion!")) { - lastMinionPickedUp = System.currentTimeMillis() + if (lastMinion != null) { + minions = minions?.editCopy { remove(lastMinion) } + lastClickedEntity = null + lastMinion = null + lastMinionOpened = 0L + } } minionUpgradePattern.matchMatcher(message) { |