diff options
author | Thunderblade73 <85900443+Thunderblade73@users.noreply.github.com> | 2024-09-17 16:10:42 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-17 16:10:42 +0200 |
commit | 864a36ff3d5b8ede1878fcbc73f2f1ceb1485150 (patch) | |
tree | 08d717e7faaec161b18c7b3db77507344fa1f548 | |
parent | 1dcc43a3f37591912f086299c298df4e0e471bd9 (diff) | |
download | skyhanni-864a36ff3d5b8ede1878fcbc73f2f1ceb1485150.tar.gz skyhanni-864a36ff3d5b8ede1878fcbc73f2f1ceb1485150.tar.bz2 skyhanni-864a36ff3d5b8ede1878fcbc73f2f1ceb1485150.zip |
Fix: Mining Update ItemCategory (#2529)
3 files changed, 13 insertions, 11 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/api/ReforgeAPI.kt b/src/main/java/at/hannibal2/skyhanni/api/ReforgeAPI.kt index 987a864af..3fb643c7c 100644 --- a/src/main/java/at/hannibal2/skyhanni/api/ReforgeAPI.kt +++ b/src/main/java/at/hannibal2/skyhanni/api/ReforgeAPI.kt @@ -75,7 +75,7 @@ object ReforgeAPI { fun isValid(itemCategory: ItemCategory?, internalName: NEUInternalName) = when (type) { ReforgeType.SWORD -> setOf( ItemCategory.SWORD, - ItemCategory.GAUNTLET, + ItemCategory.PICKAXE_AND_SWORD, ItemCategory.LONGSWORD, ItemCategory.FISHING_WEAPON, ).contains(itemCategory) @@ -98,7 +98,7 @@ object ReforgeAPI { ReforgeType.PICKAXE -> itemCategory == ItemCategory.PICKAXE || itemCategory == ItemCategory.DRILL || - itemCategory == ItemCategory.GAUNTLET + itemCategory == ItemCategory.PICKAXE_AND_SWORD ReforgeType.EQUIPMENT -> setOf( ItemCategory.CLOAK, @@ -111,7 +111,7 @@ object ReforgeAPI { ReforgeType.ROD -> itemCategory == ItemCategory.FISHING_ROD || itemCategory == ItemCategory.FISHING_WEAPON ReforgeType.SWORD_AND_ROD -> setOf( ItemCategory.SWORD, - ItemCategory.GAUNTLET, + ItemCategory.PICKAXE_AND_SWORD, ItemCategory.LONGSWORD, ItemCategory.FISHING_ROD, ItemCategory.FISHING_WEAPON, diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/PrivateIslandNoPickaxeAbility.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/PrivateIslandNoPickaxeAbility.kt index a29bcecc5..dc55af349 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/PrivateIslandNoPickaxeAbility.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/PrivateIslandNoPickaxeAbility.kt @@ -21,12 +21,10 @@ object PrivateIslandNoPickaxeAbility { if (!config.privateIslandNoPickaxeAbility) return if (event.clickType != ClickType.RIGHT_CLICK) return - when (event.itemInHand?.getItemCategoryOrNull()) { - ItemCategory.GAUNTLET, ItemCategory.PICKAXE, ItemCategory.DRILL -> { - event.cancel() - } - - else -> {} + if (event.itemInHand?.getItemCategoryOrNull()?.let { + ItemCategory.miningTools.contains(it) + } == true) { + event.cancel() } } } diff --git a/src/main/java/at/hannibal2/skyhanni/utils/ItemCategory.kt b/src/main/java/at/hannibal2/skyhanni/utils/ItemCategory.kt index 8fa41978e..08272ed08 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/ItemCategory.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/ItemCategory.kt @@ -12,7 +12,7 @@ enum class ItemCategory { FISHING_WEAPON, FISHING_ROD, AXE, - GAUNTLET, + PICKAXE_AND_SWORD, HOE, PICKAXE, SHOVEL, @@ -53,6 +53,10 @@ enum class ItemCategory { SACK, CHISEL, DYE, + ORE, + BLOCK, + DWARVEN_METAL, + GEMSTONE, NONE, ; @@ -62,7 +66,7 @@ enum class ItemCategory { fun Collection<ItemCategory>.containsItem(stack: ItemStack?) = stack?.getItemCategoryOrNull()?.let { this.contains(it) } ?: false - val miningTools = listOf(PICKAXE, DRILL, GAUNTLET) + val miningTools = listOf(PICKAXE, DRILL, PICKAXE_AND_SWORD) val armor = setOf(HELMET, CHESTPLATE, LEGGINGS, BOOTS) } |