aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2
diff options
context:
space:
mode:
authorHiZe_ <superhize@hotmail.com>2023-07-24 15:24:50 +0200
committerGitHub <noreply@github.com>2023-07-24 15:24:50 +0200
commit762da98001bf62054fa662066800c86c839f44f7 (patch)
treedfe2922d164ce28c81cdcb6d992c39d5c0c600ef /src/main/java/at/hannibal2
parentc61ef5cc98ee4d85e1b2dc88d8f72f8a2b5a4174 (diff)
downloadskyhanni-762da98001bf62054fa662066800c86c839f44f7.tar.gz
skyhanni-762da98001bf62054fa662066800c86c839f44f7.tar.bz2
skyhanni-762da98001bf62054fa662066800c86c839f44f7.zip
Merge pull request #323
* Added shadow fury to ItemAbilityooldown * check item in hand * Merge branch 'beta' of https://github.com/hannibal002/skyhanni into s… * ok don't ask * `null != "text"` is always true * Added support for STARRED_SHADOW_FURY * Merge branch 'beta' into shadow_fury_item_cooldown
Diffstat (limited to 'src/main/java/at/hannibal2')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/itemabilities/abilitycooldown/ItemAbility.kt1
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/itemabilities/abilitycooldown/ItemAbilityCooldown.kt7
-rw-r--r--src/main/java/at/hannibal2/skyhanni/utils/LorenzUtils.kt9
3 files changed, 17 insertions, 0 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/itemabilities/abilitycooldown/ItemAbility.kt b/src/main/java/at/hannibal2/skyhanni/features/itemabilities/abilitycooldown/ItemAbility.kt
index 05e61b1e3..de49befd8 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/itemabilities/abilitycooldown/ItemAbility.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/itemabilities/abilitycooldown/ItemAbility.kt
@@ -38,6 +38,7 @@ enum class ItemAbility(
WITHER_CLOAK(10),
HOLY_ICE(4),
VOODOO_DOLL_WILTED(3),
+ SHADOW_FURY(15, "STARRED_SHADOW_FURY"),
// doesn't have a sound
ENDER_BOW("Ender Warp", 30, "Ender Bow"),
diff --git a/src/main/java/at/hannibal2/skyhanni/features/itemabilities/abilitycooldown/ItemAbilityCooldown.kt b/src/main/java/at/hannibal2/skyhanni/features/itemabilities/abilitycooldown/ItemAbilityCooldown.kt
index 114d15673..b86aec0c6 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/itemabilities/abilitycooldown/ItemAbilityCooldown.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/itemabilities/abilitycooldown/ItemAbilityCooldown.kt
@@ -10,6 +10,7 @@ import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName
import at.hannibal2.skyhanni.utils.LorenzColor
import at.hannibal2.skyhanni.utils.LorenzUtils
import at.hannibal2.skyhanni.utils.LorenzUtils.between
+import at.hannibal2.skyhanni.utils.LorenzUtils.equalsOneOf
import at.hannibal2.skyhanni.utils.SkyBlockItemModifierUtils.getAbilityScrolls
import at.hannibal2.skyhanni.utils.StringUtils.matchMatcher
import net.minecraft.client.Minecraft
@@ -42,6 +43,12 @@ class ItemAbilityCooldown {
if (event.pitch == 0.61904764f && event.volume == 1f) {
ItemAbility.GYROKINETIC_WAND_LEFT.sound()
}
+ if (event.pitch == 1f && event.volume == 1f) {
+ val internalName = InventoryUtils.getItemInHand()?.getInternalName() ?: return
+ if (!internalName.equalsOneOf("SHADOW_FURY", "STARRED_SHADOW_FURY")) return
+
+ ItemAbility.SHADOW_FURY.sound()
+ }
}
if (event.soundName == "random.anvil_land") {
if (event.pitch == 0.4920635f && event.volume == 1f) {
diff --git a/src/main/java/at/hannibal2/skyhanni/utils/LorenzUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/LorenzUtils.kt
index 183cd78d7..f84d135ef 100644
--- a/src/main/java/at/hannibal2/skyhanni/utils/LorenzUtils.kt
+++ b/src/main/java/at/hannibal2/skyhanni/utils/LorenzUtils.kt
@@ -413,4 +413,13 @@ object LorenzUtils {
}
fun Field.makeAccessible() = also { isAccessible = true }
+
+ // Taken and modified from Skytils
+ @JvmStatic
+ fun Any.equalsOneOf(vararg other: Any): Boolean {
+ for (obj in other) {
+ if (this == obj) return true
+ }
+ return false
+ }
} \ No newline at end of file