diff options
author | Brandon <brandon.wamboldt@gmail.com> | 2023-09-07 08:46:26 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-07 13:46:26 +0200 |
commit | 9ac0494d86bc8a65b5075e749153e0cc6fa54ad2 (patch) | |
tree | 0e10e03e1a75a958af0e0f11f98f2350335a81f5 /src | |
parent | 7680a02ce87df2924a205783bf76371fe2c4bc94 (diff) | |
download | skyhanni-9ac0494d86bc8a65b5075e749153e0cc6fa54ad2.tar.gz skyhanni-9ac0494d86bc8a65b5075e749153e0cc6fa54ad2.tar.bz2 skyhanni-9ac0494d86bc8a65b5075e749153e0cc6fa54ad2.zip |
Fix minion pickup not removing the nametag (#443)
Fix minion pickup not removing the nametag #443
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) { |