mirror of
https://github.com/Wurst-Imperium/Wurst7.git
synced 2024-09-19 17:02:13 +02:00
Add isUnbreakable() helper method
This commit is contained in:
parent
1beb99a33c
commit
4c121f0555
@ -21,6 +21,7 @@ import net.wurstclient.hack.Hack;
|
||||
import net.wurstclient.settings.CheckboxSetting;
|
||||
import net.wurstclient.settings.SliderSetting;
|
||||
import net.wurstclient.settings.SliderSetting.ValueDisplay;
|
||||
import net.wurstclient.util.BlockUtils;
|
||||
|
||||
@SearchTags({"FastMine", "SpeedMine", "SpeedyGonzales", "fast break",
|
||||
"fast mine", "speed mine", "speedy gonzales", "NoBreakDelay",
|
||||
@ -101,7 +102,7 @@ public final class FastBreakHack extends Hack
|
||||
}
|
||||
|
||||
// Ignore unbreakable blocks to avoid slowdown issue
|
||||
if(MC.world.getBlockState(blockPos).getBlock().getHardness() < 0)
|
||||
if(BlockUtils.isUnbreakable(blockPos))
|
||||
return;
|
||||
|
||||
if(!fastBreakBlock)
|
||||
|
@ -112,6 +112,11 @@ public enum BlockUtils
|
||||
return getState(pos).calcBlockBreakingDelta(MC.player, MC.world, pos);
|
||||
}
|
||||
|
||||
public static boolean isUnbreakable(BlockPos pos)
|
||||
{
|
||||
return getBlock(pos).getHardness() < 0;
|
||||
}
|
||||
|
||||
private static VoxelShape getOutlineShape(BlockPos pos)
|
||||
{
|
||||
return getState(pos).getOutlineShape(MC.world, pos);
|
||||
|
Loading…
Reference in New Issue
Block a user