Fix issues where paxels could not destroy blocks that did not have a specific tooltypes harvest level set on them.
@@ -2,9 +2,12 @@ package mekanism.tools.item;
import java.util.HashSet;
import java.util.List;
+import javax.annotation.Nonnull;
import mekanism.common.util.LangUtils;
import mekanism.tools.common.IHasRepairType;
import mekanism.tools.common.Materials;
+import net.minecraft.block.material.Material;
+import net.minecraft.block.state.IBlockState;
import net.minecraft.client.util.ITooltipFlag;
import net.minecraft.item.ItemStack;
import net.minecraft.item.ItemTool;
@@ -31,6 +34,15 @@ public class ItemMekanismPaxel extends ItemTool implements IHasRepairType {
list.add(LangUtils.localize("tooltip.hp") + ": " + (itemstack.getMaxDamage() - itemstack.getItemDamage()));
}
+ @Override
+ public float getDestroySpeed(@Nonnull ItemStack stack, IBlockState state) {
+ Material material = state.getMaterial();
+ //TODO: 1.14 Double check the various items to see if their getDestroySpeed short paths changed
+ boolean pickaxeShortcut = material == Material.IRON || material == Material.ANVIL || material == Material.ROCK;
+ boolean axeShortcut = material == Material.WOOD || material == Material.PLANTS || material == Material.VINE;
+ return pickaxeShortcut || axeShortcut ? this.efficiency : super.getDestroySpeed(stack, state);
+ }
+
@Override
public ItemStack getRepairStack() {
return toolMaterial.getRepairItemStack();
