Jackhammer should work

This commit is contained in:
drcrazy 2019-08-13 15:04:19 +03:00
parent 2a6a91fa87
commit 62f1c521f0

View file

@ -24,8 +24,8 @@
package techreborn.items.tool; package techreborn.items.tool;
import net.minecraft.block.Block;
import net.minecraft.block.BlockState; import net.minecraft.block.BlockState;
import net.minecraft.block.Blocks;
import net.minecraft.enchantment.EnchantmentHelper; import net.minecraft.enchantment.EnchantmentHelper;
import net.minecraft.enchantment.Enchantments; import net.minecraft.enchantment.Enchantments;
import net.minecraft.entity.LivingEntity; import net.minecraft.entity.LivingEntity;
@ -42,8 +42,6 @@ import reborncore.common.powerSystem.PowerSystem;
import reborncore.common.util.ItemDurabilityExtensions; import reborncore.common.util.ItemDurabilityExtensions;
import reborncore.common.util.ItemUtils; import reborncore.common.util.ItemUtils;
import techreborn.TechReborn; import techreborn.TechReborn;
import techreborn.utils.TagUtils;
import java.util.Random; import java.util.Random;
public class ItemJackhammer extends PickaxeItem implements IEnergyItemInfo, ItemDurabilityExtensions { public class ItemJackhammer extends PickaxeItem implements IEnergyItemInfo, ItemDurabilityExtensions {
@ -60,8 +58,7 @@ public class ItemJackhammer extends PickaxeItem implements IEnergyItemInfo, Item
// ItemPickaxe // ItemPickaxe
@Override @Override
public float getMiningSpeed(ItemStack stack, BlockState state) { public float getMiningSpeed(ItemStack stack, BlockState state) {
if ((TagUtils.isOre(state, "stone") || state.getBlock() == Blocks.STONE) if (Block.isNaturalStone(state.getBlock()) && new ItemPowerManager(stack).getEnergyStored() >= cost) {
&& new ItemPowerManager(stack).getEnergyStored() >= cost) {
return miningSpeed; return miningSpeed;
} else { } else {
return 0.5F; return 0.5F;