fix some scuff from minebot

This commit is contained in:
Leijurv 2019-04-29 23:08:17 -07:00
parent c931cde3ae
commit 920ce745c2
No known key found for this signature in database
GPG Key ID: 44A3EA646EADAC6A
2 changed files with 9 additions and 6 deletions

View File

@ -160,9 +160,12 @@ public final class Settings {
/**
* Blocks that Baritone is not allowed to break
*/
public final Setting<List<Block>> blocksToAvoidBreaking = new Setting<>(new ArrayList<>(
// e.g. crafting table, beds
));
public final Setting<List<Block>> blocksToAvoidBreaking = new Setting<>(new ArrayList<>(Arrays.asList(
Blocks.CRAFTING_TABLE,
Blocks.FURNACE,
Blocks.LIT_FURNACE,
Blocks.CHEST
)));
/**
* Enables some more advanced vine features. They're honestly just gimmicks and won't ever be needed in real

View File

@ -18,6 +18,7 @@
package baritone.pathing.movement;
import baritone.Baritone;
import baritone.api.BaritoneAPI;
import baritone.api.IBaritone;
import baritone.api.pathing.movement.ActionCosts;
import baritone.api.pathing.movement.MovementStatus;
@ -55,8 +56,7 @@ public interface MovementHelper extends ActionCosts, Helper {
|| bsi.get0(x + 1, y, z).getBlock() instanceof BlockLiquid
|| bsi.get0(x - 1, y, z).getBlock() instanceof BlockLiquid
|| bsi.get0(x, y, z + 1).getBlock() instanceof BlockLiquid
|| bsi.get0(x, y, z - 1).getBlock() instanceof BlockLiquid
|| Baritone.settings().blocksToAvoidBreaking.value.contains(b);
|| bsi.get0(x, y, z - 1).getBlock() instanceof BlockLiquid;
}
static boolean canWalkThrough(IPlayerContext ctx, BetterBlockPos pos) {
@ -363,7 +363,7 @@ public interface MovementHelper extends ActionCosts, Helper {
if (block instanceof BlockLiquid) {
return COST_INF;
}
double m = Blocks.CRAFTING_TABLE.equals(block) ? 10 : 1; // TODO see if this is still necessary. it's from MineBot when we wanted to penalize breaking its crafting table
double m = Baritone.settings().blocksToAvoidBreaking.value.contains(block) ? 10 : 1;
double strVsBlock = context.toolSet.getStrVsBlock(state);
if (strVsBlock <= 0) {
return COST_INF;