aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBrandon <brandon.wamboldt@gmail.com>2023-09-07 08:46:26 -0300
committerGitHub <noreply@github.com>2023-09-07 13:46:26 +0200
commit9ac0494d86bc8a65b5075e749153e0cc6fa54ad2 (patch)
tree0e10e03e1a75a958af0e0f11f98f2350335a81f5 /src
parent7680a02ce87df2924a205783bf76371fe2c4bc94 (diff)
downloadskyhanni-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.kt14
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) {