(ItemStack stack)
| 113 | } |
| 114 | |
| 115 | public boolean hasSilkTouch(ItemStack stack) { |
| 116 | ItemEnchantments enchantments = stack.getEnchantments(); |
| 117 | for (Holder<Enchantment> enchant : enchantments.keySet()) { |
| 118 | // silk touch enchantment is still special cased as affecting block drops |
| 119 | // not possible to add custom attribute via datapack |
| 120 | if (enchant.is(Enchantments.SILK_TOUCH) && enchantments.getLevel(enchant) > 0) { |
| 121 | return true; |
| 122 | } |
| 123 | } |
| 124 | return false; |
| 125 | } |
| 126 | |
| 127 | /** |
| 128 | * Calculate which tool on the hotbar is best for mining, depending on an override setting, |
no test coverage detected