throwaways setting

This commit is contained in:
Leijurv 2018-08-14 15:19:35 -07:00
parent 45375c45bb
commit 7bc9969d93
No known key found for this signature in database
GPG Key ID: 44A3EA646EADAC6A
2 changed files with 9 additions and 10 deletions

View File

@ -17,6 +17,9 @@
package baritone.bot;
import net.minecraft.init.Blocks;
import net.minecraft.item.Item;
import java.lang.reflect.Field;
import java.util.*;
@ -37,6 +40,11 @@ public class Settings {
public Setting<Boolean> chatControl = new Setting<>(true); // probably false in impact
public Setting<Boolean> fadePath = new Setting<>(false); // give this a better name in the UI, like "better path fps" idk
public Setting<Boolean> slowPath = new Setting<>(false);
public Setting<List<Item>> acceptableThrowAwayItems = new Setting<>(Arrays.asList(
Item.getItemFromBlock(Blocks.DIRT),
Item.getItemFromBlock(Blocks.COBBLESTONE),
Item.getItemFromBlock(Blocks.NETHERRACK)
));
public final Map<String, Setting<?>> byName;
public final List<Setting<?>> allSettings;

View File

@ -29,14 +29,11 @@ import net.minecraft.client.Minecraft;
import net.minecraft.client.entity.EntityPlayerSP;
import net.minecraft.entity.Entity;
import net.minecraft.init.Blocks;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.NonNullList;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.RayTraceResult;
import java.util.Arrays;
import java.util.List;
import java.util.Optional;
/**
@ -46,12 +43,6 @@ import java.util.Optional;
*/
public interface MovementHelper extends ActionCosts, Helper {
List<Item> ACCEPTABLE_THROWAWAY_ITEMS = Arrays.asList(
Item.getItemFromBlock(Blocks.DIRT),
Item.getItemFromBlock(Blocks.COBBLESTONE),
Item.getItemFromBlock(Blocks.NETHERRACK)
);
static boolean avoidBreaking(BlockPos pos) {
Block b = BlockStateInterface.getBlock(pos);
BlockPos below = new BlockPos(pos.getX(), pos.getY() - 1, pos.getZ());
@ -200,7 +191,7 @@ public interface MovementHelper extends ActionCosts, Helper {
NonNullList<ItemStack> inv = p.inventory.mainInventory;
for (byte i = 0; i < 9; i++) {
ItemStack item = inv.get(i);
if (ACCEPTABLE_THROWAWAY_ITEMS.contains(item.getItem())) {
if (Baritone.settings().acceptableThrowAwayItems.get().contains(item.getItem())) {
if (select) {
p.inventory.currentItem = i;
}