Chainsaw fixes
This commit is contained in:
parent
bd81ca48f6
commit
2852e98901
1 changed files with 6 additions and 2 deletions
|
@ -82,8 +82,12 @@ public class ItemIndustrialChainsaw extends ItemChainsaw {
|
||||||
@Override
|
@Override
|
||||||
public boolean postMine(ItemStack stack, World worldIn, BlockState blockIn, BlockPos pos, LivingEntity entityLiving) {
|
public boolean postMine(ItemStack stack, World worldIn, BlockState blockIn, BlockPos pos, LivingEntity entityLiving) {
|
||||||
List<BlockPos> wood = new ArrayList<>();
|
List<BlockPos> wood = new ArrayList<>();
|
||||||
|
if (ItemUtils.isActive(stack)) {
|
||||||
findWood(worldIn, pos, wood, new ArrayList<>());
|
findWood(worldIn, pos, wood, new ArrayList<>());
|
||||||
wood.forEach(pos1 -> breakBlock(pos1, stack, worldIn, entityLiving, pos));
|
wood.stream()
|
||||||
|
.filter(p -> Energy.of(stack).use(cost))
|
||||||
|
.forEach(pos1 -> breakBlock(pos1, stack, worldIn, entityLiving, pos));
|
||||||
|
}
|
||||||
return super.postMine(stack, worldIn, blockIn, pos, entityLiving);
|
return super.postMine(stack, worldIn, blockIn, pos, entityLiving);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue