Merge pull request #2138 from scorbett123/swordSaver
add useSwordToMine setting.
This commit is contained in:
commit
4132d6ff61
@ -1118,6 +1118,11 @@ public final class Settings {
|
|||||||
*/
|
*/
|
||||||
public final Setting<Boolean> renderSelectionCorners = new Setting<>(true);
|
public final Setting<Boolean> renderSelectionCorners = new Setting<>(true);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Use sword to mine.
|
||||||
|
*/
|
||||||
|
public final Setting<Boolean> useSwordToMine = new Setting<>(true);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Desktop notifications
|
* Desktop notifications
|
||||||
*/
|
*/
|
||||||
|
@ -26,6 +26,7 @@ import net.minecraft.init.Enchantments;
|
|||||||
import net.minecraft.init.MobEffects;
|
import net.minecraft.init.MobEffects;
|
||||||
import net.minecraft.item.Item.ToolMaterial;
|
import net.minecraft.item.Item.ToolMaterial;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.item.ItemSword;
|
||||||
import net.minecraft.item.ItemTool;
|
import net.minecraft.item.ItemTool;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
@ -124,6 +125,10 @@ public class ToolSet {
|
|||||||
IBlockState blockState = b.getDefaultState();
|
IBlockState blockState = b.getDefaultState();
|
||||||
for (int i = 0; i < 9; i++) {
|
for (int i = 0; i < 9; i++) {
|
||||||
ItemStack itemStack = player.inventory.getStackInSlot(i);
|
ItemStack itemStack = player.inventory.getStackInSlot(i);
|
||||||
|
if (!Baritone.settings().useSwordToMine.value && itemStack.getItem() instanceof ItemSword) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if (Baritone.settings().itemSaver.value && itemStack.getItemDamage() >= itemStack.getMaxDamage() && itemStack.getMaxDamage() > 1) {
|
if (Baritone.settings().itemSaver.value && itemStack.getItemDamage() >= itemStack.getMaxDamage() && itemStack.getMaxDamage() > 1) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user