diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-01-26 13:07:41 +0100 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-01-26 13:07:41 +0100 |
commit | 9b2bd016410a30ffc370cc9990ff9244292380b9 (patch) | |
tree | c28a6b3306c60873fa3c40aa9ad0bef55b15a94f /src/main/java/at/hannibal2 | |
parent | ae48ef854f96fe5a6d60d9a52f9db680de77fdf3 (diff) | |
download | skyhanni-9b2bd016410a30ffc370cc9990ff9244292380b9.tar.gz skyhanni-9b2bd016410a30ffc370cc9990ff9244292380b9.tar.bz2 skyhanni-9b2bd016410a30ffc370cc9990ff9244292380b9.zip |
Fixed Non God Pot Effects.
Diffstat (limited to 'src/main/java/at/hannibal2')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/misc/NonGodPotEffectDisplay.kt | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/NonGodPotEffectDisplay.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/NonGodPotEffectDisplay.kt index 5adafb6b4..65b7992d6 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/NonGodPotEffectDisplay.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/NonGodPotEffectDisplay.kt @@ -4,10 +4,10 @@ import at.hannibal2.skyhanni.SkyHanniMod import at.hannibal2.skyhanni.events.LorenzChatEvent import at.hannibal2.skyhanni.events.PacketEvent import at.hannibal2.skyhanni.events.ProfileApiDataLoadedEvent -import at.hannibal2.skyhanni.test.GriffinJavaUtils import at.hannibal2.skyhanni.utils.ItemUtils.getLore import at.hannibal2.skyhanni.utils.ItemUtils.name import at.hannibal2.skyhanni.utils.LorenzUtils +import at.hannibal2.skyhanni.utils.LorenzUtils.sorted import at.hannibal2.skyhanni.utils.RenderUtils.renderStrings import at.hannibal2.skyhanni.utils.StringUtils import net.minecraft.network.play.server.S30PacketWindowItems @@ -30,6 +30,16 @@ class NonGodPotEffectDisplay { "smoldering_polarization" to "§aSmoldering Polarization I", "mushed_glowy_tonic" to "§2Mushed Glowy Tonic I", "wisp_ice" to "§bWisp's Ice-Flavored Water I", + + "invisibility" to "§8Invisibility I", // when wearing sorrow armor + + // Bartender Mixins + "ZOMBIE_BRAIN" to "§9Zombie Brain Mixin", + "SPIDER_EGG" to "§9Spider Egg Mixin", + "WOLF_FUR" to "§9Wolf Fur Mixin", + "END_PORTAL_FUMES" to "§9End Portal Fumes", + //TODO fix typo + "GABAGOEY" to "§9Gabagoey Mixin", ) private var patternEffectsCount = Pattern.compile("§7You have §e(\\d+) §7non-god effects\\.") @@ -66,6 +76,10 @@ class NonGodPotEffectDisplay { } for (effect in activeEffects.sorted()) { val label = effect.key + if (label.contains("Invisibility")) continue + if (label.contains("Mixin")) continue + if (label.contains("Fumes")) continue + val until = effect.value val seconds = (until - now) / 1000 val format = StringUtils.formatDuration(seconds) @@ -182,7 +196,7 @@ class NonGodPotEffectDisplay { if (event.type != RenderGameOverlayEvent.ElementType.ALL) return if (!isEnabled()) return - SkyHanniMod.feature.misc.nonGodPotEffectPos.renderStrings(display) + SkyHanniMod.feature.misc.nonGodPotEffectPos.renderStrings(display, extraSpace = 3) } @SubscribeEvent @@ -196,10 +210,12 @@ class NonGodPotEffectDisplay { val time = effect["ticks_remaining"].asLong / 20 val newValue = System.currentTimeMillis() + time * 1000 - val old = activeEffects.getOrDefault(label, 0) - val diff = newValue - old + if (label.contains("Invisibility")) { + activeEffects[label] = System.currentTimeMillis() + 1000 * 60 * 60 * 24 + } else { activeEffects[label] = newValue } + } } private fun isEnabled(): Boolean { |