diff --git a/src/api/java/baritone/api/Settings.java b/src/api/java/baritone/api/Settings.java index 651b6af3..47459ae8 100644 --- a/src/api/java/baritone/api/Settings.java +++ b/src/api/java/baritone/api/Settings.java @@ -150,7 +150,7 @@ public final class Settings { /** * Blocks that Baritone will attempt to avoid (Used in avoidance) */ - public final Setting> blocksToAvoid = new Setting<>(new ArrayList<>(Arrays.asList( + public final Setting> blocksToAvoid = new Setting<>(new LinkedList<>(Arrays.asList( // Leave Empty by Default ))); @@ -257,7 +257,7 @@ public final class Settings { public final Setting mobAvoidanceCoefficient = new Setting<>(1.5); public final Setting mobAvoidanceRadius = new Setting<>(8); - + /** * When running a goto towards a container block (chest, ender chest, furnace, etc), * right click and open it once you arrive. diff --git a/src/api/java/baritone/api/utils/SettingsUtil.java b/src/api/java/baritone/api/utils/SettingsUtil.java index 60014bbd..f5cb17e1 100644 --- a/src/api/java/baritone/api/utils/SettingsUtil.java +++ b/src/api/java/baritone/api/utils/SettingsUtil.java @@ -18,6 +18,7 @@ package baritone.api.utils; import baritone.api.Settings; +import net.minecraft.block.Block; import net.minecraft.item.Item; import net.minecraft.util.EnumFacing; import net.minecraft.util.ResourceLocation; @@ -147,6 +148,7 @@ public class SettingsUtil { FLOAT(Float.class, Float::parseFloat), LONG(Long.class, Long::parseLong), + BLOCK_LIST(LinkedList.class, str -> Stream.of(str.split(",")).map(String::trim).map(BlockUtils::stringToBlockRequired).collect(Collectors.toCollection(LinkedList::new)), list -> ((LinkedList) list).stream().map(BlockUtils::blockToString).collect(Collectors.joining(","))), ITEM_LIST(ArrayList.class, str -> Stream.of(str.split(",")).map(String::trim).map(Item::getByNameOrId).collect(Collectors.toCollection(ArrayList::new)), list -> ((ArrayList) list).stream().map(Item.REGISTRY::getNameForObject).map(ResourceLocation::toString).collect(Collectors.joining(","))), COLOR(Color.class, str -> new Color(Integer.parseInt(str.split(",")[0]), Integer.parseInt(str.split(",")[1]), Integer.parseInt(str.split(",")[2])), color -> color.getRed() + "," + color.getGreen() + "," + color.getBlue()), ENUMFACING(EnumFacing.class, EnumFacing::byName);