JackHammers should respect ores when AoE mining.

This commit is contained in:
drcrazy 2020-09-16 00:43:28 +03:00
parent 1360187f16
commit b1fee2e741
2 changed files with 12 additions and 1 deletions

View file

@ -38,6 +38,7 @@ import net.minecraft.util.Hand;
import net.minecraft.util.TypedActionResult; import net.minecraft.util.TypedActionResult;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World; import net.minecraft.world.World;
import org.jetbrains.annotations.Nullable;
import reborncore.common.misc.MultiBlockBreakingTool; import reborncore.common.misc.MultiBlockBreakingTool;
import reborncore.common.util.ItemUtils; import reborncore.common.util.ItemUtils;
import team.reborn.energy.EnergyTier; import team.reborn.energy.EnergyTier;
@ -47,7 +48,6 @@ import techreborn.items.tool.MiningLevel;
import techreborn.utils.MessageIDs; import techreborn.utils.MessageIDs;
import techreborn.utils.ToolsUtil; import techreborn.utils.ToolsUtil;
import org.jetbrains.annotations.Nullable;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
import java.util.Set; import java.util.Set;
@ -63,7 +63,13 @@ public class AdvancedJackhammerItem extends JackhammerItem implements MultiBlock
if (originalPos.equals(pos)) { if (originalPos.equals(pos)) {
return false; return false;
} }
BlockState blockState = worldIn.getBlockState(pos); BlockState blockState = worldIn.getBlockState(pos);
if (ToolsUtil.JackHammerSkippedBlocks(blockState)){
return false;
}
return (stack.getItem().isEffectiveOn(blockState)); return (stack.getItem().isEffectiveOn(blockState));
} }

View file

@ -92,6 +92,11 @@ public class IndustrialJackhammerItem extends JackhammerItem implements MultiBlo
return false; return false;
} }
BlockState blockState = worldIn.getBlockState(pos); BlockState blockState = worldIn.getBlockState(pos);
if (ToolsUtil.JackHammerSkippedBlocks(blockState)){
return false;
}
return (stack.getItem().isEffectiveOn(blockState)); return (stack.getItem().isEffectiveOn(blockState));
} }