toInclude) throws IOException {
System.out.println("Running Determinizer");
System.out.println(" Input path: " + inputPath);
System.out.println(" Output path: " + outputPath);
@@ -66,10 +63,30 @@ public class Determinizer {
if (entry.getName().endsWith(".refmap.json")) {
JsonObject object = new JsonParser().parse(new InputStreamReader(jarFile.getInputStream(entry))).getAsJsonObject();
jos.write(writeSorted(object).getBytes());
+ } else if (entry.getName().equals("META-INF/MANIFEST.MF") && toInclude.isPresent()) { // only replace for forge jar
+ ByteArrayOutputStream cancer = new ByteArrayOutputStream();
+ copy(jarFile.getInputStream(entry), cancer);
+ String manifest = new String(cancer.toByteArray());
+ if (!manifest.contains("baritone.launch.BaritoneTweaker")) {
+ throw new IllegalStateException("unable to replace");
+ }
+ manifest = manifest.replace("baritone.launch.BaritoneTweaker", "org.spongepowered.asm.launch.MixinTweaker");
+ jos.write(manifest.getBytes());
} else {
copy(jarFile.getInputStream(entry), jos);
}
}
+ if (toInclude.isPresent()) {
+ try (JarFile mixin = new JarFile(toInclude.get())) {
+ for (JarEntry entry : mixin.stream().sorted(Comparator.comparing(JarEntry::getName)).collect(Collectors.toList())) {
+ if (entry.getName().startsWith("META-INF") && !entry.getName().startsWith("META-INF/services")) {
+ continue;
+ }
+ jos.putNextEntry(entry);
+ copy(mixin.getInputStream(entry), jos);
+ }
+ }
+ }
jos.finish();
}
}
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
index 59006a9e..599a02b7 100755
--- a/gradle/wrapper/gradle-wrapper.properties
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -1,6 +1,6 @@
-#Tue Jul 31 21:56:56 PDT 2018
-distributionBase=GRADLE_USER_HOME
-distributionPath=wrapper/dists
-zipStoreBase=GRADLE_USER_HOME
-zipStorePath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-4.9-all.zip
+#Tue Jul 31 21:56:56 PDT 2018
+distributionBase=GRADLE_USER_HOME
+distributionPath=wrapper/dists
+zipStoreBase=GRADLE_USER_HOME
+zipStorePath=wrapper/dists
+distributionUrl=https\://services.gradle.org/distributions/gradle-4.9-all.zip
diff --git a/gradlew.bat b/gradlew.bat
index e95643d6..f9553162 100755
--- a/gradlew.bat
+++ b/gradlew.bat
@@ -1,84 +1,84 @@
-@if "%DEBUG%" == "" @echo off
-@rem ##########################################################################
-@rem
-@rem Gradle startup script for Windows
-@rem
-@rem ##########################################################################
-
-@rem Set local scope for the variables with windows NT shell
-if "%OS%"=="Windows_NT" setlocal
-
-set DIRNAME=%~dp0
-if "%DIRNAME%" == "" set DIRNAME=.
-set APP_BASE_NAME=%~n0
-set APP_HOME=%DIRNAME%
-
-@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
-set DEFAULT_JVM_OPTS=
-
-@rem Find java.exe
-if defined JAVA_HOME goto findJavaFromJavaHome
-
-set JAVA_EXE=java.exe
-%JAVA_EXE% -version >NUL 2>&1
-if "%ERRORLEVEL%" == "0" goto init
-
-echo.
-echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
-echo.
-echo Please set the JAVA_HOME variable in your environment to match the
-echo location of your Java installation.
-
-goto fail
-
-:findJavaFromJavaHome
-set JAVA_HOME=%JAVA_HOME:"=%
-set JAVA_EXE=%JAVA_HOME%/bin/java.exe
-
-if exist "%JAVA_EXE%" goto init
-
-echo.
-echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
-echo.
-echo Please set the JAVA_HOME variable in your environment to match the
-echo location of your Java installation.
-
-goto fail
-
-:init
-@rem Get command-line arguments, handling Windows variants
-
-if not "%OS%" == "Windows_NT" goto win9xME_args
-
-:win9xME_args
-@rem Slurp the command line arguments.
-set CMD_LINE_ARGS=
-set _SKIP=2
-
-:win9xME_args_slurp
-if "x%~1" == "x" goto execute
-
-set CMD_LINE_ARGS=%*
-
-:execute
-@rem Setup the command line
-
-set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
-
-@rem Execute Gradle
-"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
-
-:end
-@rem End local scope for the variables with windows NT shell
-if "%ERRORLEVEL%"=="0" goto mainEnd
-
-:fail
-rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
-rem the _cmd.exe /c_ return code!
-if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
-exit /b 1
-
-:mainEnd
-if "%OS%"=="Windows_NT" endlocal
-
-:omega
+@if "%DEBUG%" == "" @echo off
+@rem ##########################################################################
+@rem
+@rem Gradle startup script for Windows
+@rem
+@rem ##########################################################################
+
+@rem Set local scope for the variables with windows NT shell
+if "%OS%"=="Windows_NT" setlocal
+
+set DIRNAME=%~dp0
+if "%DIRNAME%" == "" set DIRNAME=.
+set APP_BASE_NAME=%~n0
+set APP_HOME=%DIRNAME%
+
+@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+set DEFAULT_JVM_OPTS=
+
+@rem Find java.exe
+if defined JAVA_HOME goto findJavaFromJavaHome
+
+set JAVA_EXE=java.exe
+%JAVA_EXE% -version >NUL 2>&1
+if "%ERRORLEVEL%" == "0" goto init
+
+echo.
+echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:findJavaFromJavaHome
+set JAVA_HOME=%JAVA_HOME:"=%
+set JAVA_EXE=%JAVA_HOME%/bin/java.exe
+
+if exist "%JAVA_EXE%" goto init
+
+echo.
+echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:init
+@rem Get command-line arguments, handling Windows variants
+
+if not "%OS%" == "Windows_NT" goto win9xME_args
+
+:win9xME_args
+@rem Slurp the command line arguments.
+set CMD_LINE_ARGS=
+set _SKIP=2
+
+:win9xME_args_slurp
+if "x%~1" == "x" goto execute
+
+set CMD_LINE_ARGS=%*
+
+:execute
+@rem Setup the command line
+
+set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
+
+@rem Execute Gradle
+"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
+
+:end
+@rem End local scope for the variables with windows NT shell
+if "%ERRORLEVEL%"=="0" goto mainEnd
+
+:fail
+rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
+rem the _cmd.exe /c_ return code!
+if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
+exit /b 1
+
+:mainEnd
+if "%OS%"=="Windows_NT" endlocal
+
+:omega
diff --git a/scripts/proguard.pro b/scripts/proguard.pro
index 07e1ec41..4ac0f723 100644
--- a/scripts/proguard.pro
+++ b/scripts/proguard.pro
@@ -12,14 +12,16 @@
-flattenpackagehierarchy
-repackageclasses 'baritone'
+# lwjgl is weird
+-dontwarn org.lwjgl.**
+
-keep class baritone.api.** { *; } # this is the keep api
# service provider needs these class names
-keep class baritone.BaritoneProvider
-keep class baritone.api.IBaritoneProvider
-# hack
--keep class baritone.utils.ExampleBaritoneControl { *; } # have to include this string to remove this keep in the standalone build: # this is the keep api
+-keep class baritone.api.utils.MyChunkPos { *; } # even in standalone we need to keep this for gson reflect
# setting names are reflected from field names, so keep field names
-keepclassmembers class baritone.api.Settings {
@@ -29,6 +31,11 @@
# need to keep mixin names
-keep class baritone.launch.** { *; }
+#try to keep usage of schematica in separate classes
+-keep class baritone.utils.schematic.schematica.**
+#proguard doesnt like it when it cant find our fake schematica classes
+-dontwarn baritone.utils.schematic.schematica.**
+
# copy all necessary libraries into tempLibraries to build
# The correct jar will be copied from the forgegradle cache based on the mapping type being compiled with
diff --git a/settings.gradle b/settings.gradle
index baa9dfc9..567f8411 100755
--- a/settings.gradle
+++ b/settings.gradle
@@ -1,19 +1,19 @@
-/*
- * This file is part of Baritone.
- *
- * Baritone is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * Baritone is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with Baritone. If not, see .
- */
-
-rootProject.name = 'baritone'
-
+/*
+ * This file is part of Baritone.
+ *
+ * Baritone is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * Baritone is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with Baritone. If not, see .
+ */
+
+rootProject.name = 'baritone'
+
diff --git a/src/api/java/baritone/api/BaritoneAPI.java b/src/api/java/baritone/api/BaritoneAPI.java
index c1227830..53937bd8 100644
--- a/src/api/java/baritone/api/BaritoneAPI.java
+++ b/src/api/java/baritone/api/BaritoneAPI.java
@@ -23,9 +23,7 @@ import java.util.Iterator;
import java.util.ServiceLoader;
/**
- * API exposure for various things implemented in Baritone.
- *
- * W.I.P
+ * Exposes the {@link IBaritoneProvider} instance and the {@link Settings} instance for API usage.
*
* @author Brady
* @since 9/23/2018
@@ -36,12 +34,12 @@ public final class BaritoneAPI {
private static final Settings settings;
static {
+ settings = new Settings();
+ SettingsUtil.readAndApply(settings);
+
ServiceLoader baritoneLoader = ServiceLoader.load(IBaritoneProvider.class);
Iterator instances = baritoneLoader.iterator();
provider = instances.next();
-
- settings = new Settings();
- SettingsUtil.readAndApply(settings);
}
public static IBaritoneProvider getProvider() {
diff --git a/src/api/java/baritone/api/IBaritone.java b/src/api/java/baritone/api/IBaritone.java
index 6bdb7d10..8c5de47a 100644
--- a/src/api/java/baritone/api/IBaritone.java
+++ b/src/api/java/baritone/api/IBaritone.java
@@ -22,12 +22,11 @@ import baritone.api.behavior.IPathingBehavior;
import baritone.api.cache.IWorldProvider;
import baritone.api.event.listener.IEventBus;
import baritone.api.pathing.calc.IPathingControlManager;
-import baritone.api.process.ICustomGoalProcess;
-import baritone.api.process.IFollowProcess;
-import baritone.api.process.IGetToBlockProcess;
-import baritone.api.process.IMineProcess;
+import baritone.api.process.*;
+import baritone.api.selection.ISelectionManager;
import baritone.api.utils.IInputOverrideHandler;
import baritone.api.utils.IPlayerContext;
+import baritone.api.utils.command.manager.ICommandManager;
/**
* @author Brady
@@ -36,10 +35,10 @@ import baritone.api.utils.IPlayerContext;
public interface IBaritone {
/**
- * @return The {@link IFollowProcess} instance
- * @see IFollowProcess
+ * @return The {@link IPathingBehavior} instance
+ * @see IPathingBehavior
*/
- IFollowProcess getFollowProcess();
+ IPathingBehavior getPathingBehavior();
/**
* @return The {@link ILookBehavior} instance
@@ -47,6 +46,12 @@ public interface IBaritone {
*/
ILookBehavior getLookBehavior();
+ /**
+ * @return The {@link IFollowProcess} instance
+ * @see IFollowProcess
+ */
+ IFollowProcess getFollowProcess();
+
/**
* @return The {@link IMineProcess} instance
* @see IMineProcess
@@ -54,10 +59,34 @@ public interface IBaritone {
IMineProcess getMineProcess();
/**
- * @return The {@link IPathingBehavior} instance
- * @see IPathingBehavior
+ * @return The {@link IBuilderProcess} instance
+ * @see IBuilderProcess
*/
- IPathingBehavior getPathingBehavior();
+ IBuilderProcess getBuilderProcess();
+
+ /**
+ * @return The {@link IExploreProcess} instance
+ * @see IExploreProcess
+ */
+ IExploreProcess getExploreProcess();
+
+ /**
+ * @return The {@link IFarmProcess} instance
+ * @see IFarmProcess
+ */
+ IFarmProcess getFarmProcess();
+
+ /**
+ * @return The {@link ICustomGoalProcess} instance
+ * @see ICustomGoalProcess
+ */
+ ICustomGoalProcess getCustomGoalProcess();
+
+ /**
+ * @return The {@link IGetToBlockProcess} instance
+ * @see IGetToBlockProcess
+ */
+ IGetToBlockProcess getGetToBlockProcess();
/**
* @return The {@link IWorldProvider} instance
@@ -65,15 +94,47 @@ public interface IBaritone {
*/
IWorldProvider getWorldProvider();
+ /**
+ * Returns the {@link IPathingControlManager} for this {@link IBaritone} instance, which is responsible
+ * for managing the {@link IBaritoneProcess}es which control the {@link IPathingBehavior} state.
+ *
+ * @return The {@link IPathingControlManager} instance
+ * @see IPathingControlManager
+ */
IPathingControlManager getPathingControlManager();
+ /**
+ * @return The {@link IInputOverrideHandler} instance
+ * @see IInputOverrideHandler
+ */
IInputOverrideHandler getInputOverrideHandler();
- ICustomGoalProcess getCustomGoalProcess();
-
- IGetToBlockProcess getGetToBlockProcess();
-
+ /**
+ * @return The {@link IPlayerContext} instance
+ * @see IPlayerContext
+ */
IPlayerContext getPlayerContext();
+ /**
+ * @return The {@link IEventBus} instance
+ * @see IEventBus
+ */
IEventBus getGameEventHandler();
+
+ /**
+ * @return The {@link ISelectionManager} instance
+ * @see ISelectionManager
+ */
+ ISelectionManager getSelectionManager();
+
+ /**
+ * @return The {@link ICommandManager} instance
+ * @see ICommandManager
+ */
+ ICommandManager getCommandManager();
+
+ /**
+ * Open click
+ */
+ void openClick();
}
diff --git a/src/api/java/baritone/api/IBaritoneProvider.java b/src/api/java/baritone/api/IBaritoneProvider.java
index d66f7831..ac4d623e 100644
--- a/src/api/java/baritone/api/IBaritoneProvider.java
+++ b/src/api/java/baritone/api/IBaritoneProvider.java
@@ -22,9 +22,12 @@ import baritone.api.cache.IWorldScanner;
import net.minecraft.client.entity.EntityPlayerSP;
import java.util.List;
+import java.util.Objects;
/**
- * @author Leijurv
+ * Provides the present {@link IBaritone} instances
+ *
+ * @author leijurv
*/
public interface IBaritoneProvider {
@@ -48,18 +51,19 @@ public interface IBaritoneProvider {
/**
* Provides the {@link IBaritone} instance for a given {@link EntityPlayerSP}. This will likely be
- * replaced with {@code #getBaritoneForUser(IBaritoneUser)} when {@code bot-system} is merged.
+ * replaced with or be overloaded in addition to {@code #getBaritoneForUser(IBaritoneUser)} when
+ * {@code bot-system} is merged into {@code master}.
*
* @param player The player
* @return The {@link IBaritone} instance.
*/
default IBaritone getBaritoneForPlayer(EntityPlayerSP player) {
for (IBaritone baritone : getAllBaritones()) {
- if (player.equals(baritone.getPlayerContext().player())) {
+ if (Objects.equals(player, baritone.getPlayerContext().player())) {
return baritone;
}
}
- throw new IllegalStateException("No baritone for player " + player);
+ return null;
}
/**
diff --git a/src/api/java/baritone/api/Settings.java b/src/api/java/baritone/api/Settings.java
index 89716a38..8d54cbde 100644
--- a/src/api/java/baritone/api/Settings.java
+++ b/src/api/java/baritone/api/Settings.java
@@ -17,83 +17,96 @@
package baritone.api;
+import baritone.api.utils.SettingsUtil;
+import baritone.api.utils.TypeUtils;
+import net.minecraft.block.Block;
import net.minecraft.client.Minecraft;
import net.minecraft.init.Blocks;
import net.minecraft.item.Item;
+import net.minecraft.util.math.Vec3i;
import net.minecraft.util.text.ITextComponent;
import java.awt.*;
import java.lang.reflect.Field;
-import java.util.*;
+import java.lang.reflect.ParameterizedType;
+import java.lang.reflect.Type;
import java.util.List;
+import java.util.*;
import java.util.function.Consumer;
/**
- * Baritone's settings
+ * Baritone's settings. Settings apply to all Baritone instances.
*
* @author leijurv
*/
-public class Settings {
+public final class Settings {
/**
* Allow Baritone to break blocks
*/
- public Setting allowBreak = new Setting<>(true);
+ public final Setting allowBreak = new Setting<>(true);
/**
* Allow Baritone to sprint
*/
- public Setting allowSprint = new Setting<>(true);
+ public final Setting allowSprint = new Setting<>(true);
/**
* Allow Baritone to place blocks
*/
- public Setting allowPlace = new Setting<>(true);
+ public final Setting allowPlace = new Setting<>(true);
/**
* Allow Baritone to move items in your inventory to your hotbar
*/
- public Setting allowInventory = new Setting<>(false);
+ public final Setting allowInventory = new Setting<>(false);
/**
* It doesn't actually take twenty ticks to place a block, this cost is so high
- * because we want to generally conserve blocks which might be limited
+ * because we want to generally conserve blocks which might be limited.
+ *
+ * Decrease to make Baritone more often consider paths that would require placing blocks
*/
- public Setting blockPlacementPenalty = new Setting<>(20D);
+ public final Setting blockPlacementPenalty = new Setting<>(20D);
/**
* This is just a tiebreaker to make it less likely to break blocks if it can avoid it.
* For example, fire has a break cost of 0, this makes it nonzero, so all else being equal
* it will take an otherwise equivalent route that doesn't require it to put out fire.
*/
- public Setting blockBreakAdditionalPenalty = new Setting<>(2D);
+ public final Setting blockBreakAdditionalPenalty = new Setting<>(2D);
/**
- * Additional penalty for hitting the space bar (ascend, pillar, or parkour) beacuse it uses hunger
+ * Additional penalty for hitting the space bar (ascend, pillar, or parkour) because it uses hunger
*/
- public Setting jumpPenalty = new Setting<>(2D);
+ public final Setting jumpPenalty = new Setting<>(2D);
/**
* Walking on water uses up hunger really quick, so penalize it
*/
- public Setting walkOnWaterOnePenalty = new Setting<>(5D);
+ public final Setting walkOnWaterOnePenalty = new Setting<>(3D);
/**
* Allow Baritone to fall arbitrary distances and place a water bucket beneath it.
* Reliability: questionable.
*/
- public Setting allowWaterBucketFall = new Setting<>(true);
+ public final Setting allowWaterBucketFall = new Setting<>(true);
/**
* Allow Baritone to assume it can walk on still water just like any other block.
* This functionality is assumed to be provided by a separate library that might have imported Baritone.
*/
- public Setting assumeWalkOnWater = new Setting<>(false);
+ public final Setting assumeWalkOnWater = new Setting<>(false);
+
+ /**
+ * If you have Fire Resistance and Jesus then I guess you could turn this on lol
+ */
+ public final Setting assumeWalkOnLava = new Setting<>(false);
/**
* Assume step functionality; don't jump on an Ascend.
*/
- public Setting assumeStep = new Setting<>(false);
+ public final Setting assumeStep = new Setting<>(false);
/**
* Assume safe walk functionality; don't sneak on a backplace traverse.
@@ -102,14 +115,21 @@ public class Settings {
* it won't sneak right click, it'll just right click, which means it'll open the chest instead of placing
* against it. That's why this defaults to off.
*/
- public Setting assumeSafeWalk = new Setting<>(false);
+ public final Setting assumeSafeWalk = new Setting<>(false);
/**
* If true, parkour is allowed to make jumps when standing on blocks at the maximum height, so player feet is y=256
*
- * Defaults to false because this fails on NCP
+ * Defaults to false because this fails on constantiam. Please let me know if this is ever disabled. Please.
*/
- public Setting allowJumpAt256 = new Setting<>(false);
+ public final Setting allowJumpAt256 = new Setting<>(false);
+
+ /**
+ * This should be monetized it's so good
+ *
+ * Defaults to true, but only actually takes effect if allowParkour is also true
+ */
+ public final Setting allowParkourAscend = new Setting<>(true);
/**
* Allow descending diagonally
@@ -118,45 +138,120 @@ public class Settings {
*
* For a generic "take some risks" mode I'd turn on this one, parkour, and parkour place.
*/
- public Setting allowDiagonalDescend = new Setting<>(false);
+ public final Setting allowDiagonalDescend = new Setting<>(false);
+
+ /**
+ * Allow diagonal ascending
+ *
+ * Actually pretty safe, much safer than diagonal descend tbh
+ */
+ public final Setting allowDiagonalAscend = new Setting<>(false);
+
+ /**
+ * Allow mining the block directly beneath its feet
+ *
+ * Turn this off to force it to make more staircases and less shafts
+ */
+ public final Setting allowDownward = new Setting<>(true);
/**
* Blocks that Baritone is allowed to place (as throwaway, for sneak bridging, pillaring, etc.)
*/
- public Setting> acceptableThrowawayItems = new Setting<>(new ArrayList<>(Arrays.asList(
+ public final Setting> acceptableThrowawayItems = new Setting<>(new ArrayList<>(Arrays.asList(
Item.getItemFromBlock(Blocks.DIRT),
Item.getItemFromBlock(Blocks.COBBLESTONE),
- Item.getItemFromBlock(Blocks.NETHERRACK)
+ Item.getItemFromBlock(Blocks.NETHERRACK),
+ Item.getItemFromBlock(Blocks.STONE)
)));
+ /**
+ * Blocks that Baritone will attempt to avoid (Used in avoidance)
+ */
+ public final Setting> blocksToAvoid = new Setting<>(new ArrayList<>(
+ // Leave Empty by Default
+ ));
+
+ /**
+ * Blocks that Baritone is not allowed to break
+ */
+ public final Setting> blocksToAvoidBreaking = new Setting<>(new ArrayList<>(Arrays.asList( // TODO can this be a HashSet or ImmutableSet?
+ Blocks.CRAFTING_TABLE,
+ Blocks.FURNACE,
+ Blocks.LIT_FURNACE,
+ Blocks.CHEST,
+ Blocks.TRAPPED_CHEST,
+ Blocks.STANDING_SIGN,
+ Blocks.WALL_SIGN
+ )));
+
+ /**
+ * If this setting is true, Baritone will never break a block that is adjacent to an unsupported falling block.
+ *
+ * I.E. it will never trigger cascading sand / gravel falls
+ */
+ public final Setting avoidUpdatingFallingBlocks = new Setting<>(true);
+
/**
* Enables some more advanced vine features. They're honestly just gimmicks and won't ever be needed in real
* pathing scenarios. And they can cause Baritone to get trapped indefinitely in a strange scenario.
+ *
+ * Almost never turn this on lol
*/
- public Setting allowVines = new Setting<>(false);
+ public final Setting allowVines = new Setting<>(false);
/**
* Slab behavior is complicated, disable this for higher path reliability. Leave enabled if you have bottom slabs
* everywhere in your base.
*/
- public Setting allowWalkOnBottomSlab = new Setting<>(true);
+ public final Setting allowWalkOnBottomSlab = new Setting<>(true);
/**
* You know what it is
*
* But it's very unreliable and falls off when cornering like all the time so.
+ *
+ * It also overshoots the landing pretty much always (making contact with the next block over), so be careful
*/
- public Setting allowParkour = new Setting<>(false);
+ public final Setting allowParkour = new Setting<>(false);
/**
- * Like parkour, but even more unreliable!
+ * Actually pretty reliable.
+ *
+ * Doesn't make it any more dangerous compared to just normal allowParkour th
*/
- public Setting allowParkourPlace = new Setting<>(false);
+ public final Setting allowParkourPlace = new Setting<>(false);
/**
* For example, if you have Mining Fatigue or Haste, adjust the costs of breaking blocks accordingly.
*/
- public Setting considerPotionEffects = new Setting<>(true);
+ public final Setting considerPotionEffects = new Setting<>(true);
+
+ /**
+ * Sprint and jump a block early on ascends wherever possible
+ */
+ public final Setting sprintAscends = new Setting<>(true);
+
+ /**
+ * If we overshoot a traverse and end up one block beyond the destination, mark it as successful anyway.
+ *
+ * This helps with speed at >=20m/s
+ */
+ public final Setting overshootTraverse = new Setting<>(true);
+
+ /**
+ * When breaking blocks for a movement, wait until all falling blocks have settled before continuing
+ */
+ public final Setting pauseMiningForFallingBlocks = new Setting<>(true);
+
+ /**
+ * How many ticks between right clicks are allowed. Default in game is 4
+ */
+ public final Setting rightClickSpeed = new Setting<>(4);
+
+ /**
+ * How many degrees to randomize the pitch and yaw every tick. Set to 0 to disable
+ */
+ public final Setting randomLooking = new Setting<>(0.01d);
/**
* This is the big A* setting.
@@ -173,131 +268,139 @@ public class Settings {
*
* Finding the optimal path is worth it, so it's the default.
*/
- public Setting costHeuristic = new Setting<>(3.563);
+ public final Setting costHeuristic = new Setting<>(3.563);
// a bunch of obscure internal A* settings that you probably don't want to change
/**
* The maximum number of times it will fetch outside loaded or cached chunks before assuming that
* pathing has reached the end of the known area, and should therefore stop.
*/
- public Setting pathingMaxChunkBorderFetch = new Setting<>(50);
+ public final Setting pathingMaxChunkBorderFetch = new Setting<>(50);
/**
* Set to 1.0 to effectively disable this feature
*
* @see Issue #18
*/
- public Setting backtrackCostFavoringCoefficient = new Setting<>(0.5);
+ public final Setting backtrackCostFavoringCoefficient = new Setting<>(0.5);
/**
* Toggle the following 4 settings
*
- * They have a noticable performance impact, so they default off
+ * They have a noticeable performance impact, so they default off
+ *
+ * Specifically, building up the avoidance map on the main thread before pathing starts actually takes a noticeable
+ * amount of time, especially when there are a lot of mobs around, and your game jitters for like 200ms while doing so
*/
- public Setting avoidance = new Setting<>(false);
+ public final Setting avoidance = new Setting<>(false);
+
/**
* Set to 1.0 to effectively disable this feature
*
* Set below 1.0 to go out of your way to walk near mob spawners
*/
- public Setting mobSpawnerAvoidanceCoefficient = new Setting<>(2.0);
+ public final Setting mobSpawnerAvoidanceCoefficient = new Setting<>(2.0);
- public Setting mobSpawnerAvoidanceRadius = new Setting<>(16);
+ public final Setting mobSpawnerAvoidanceRadius = new Setting<>(16);
/**
* Set to 1.0 to effectively disable this feature
*
* Set below 1.0 to go out of your way to walk near mobs
*/
- public Setting mobAvoidanceCoefficient = new Setting<>(1.5);
+ public final Setting mobAvoidanceCoefficient = new Setting<>(1.5);
- public Setting mobAvoidanceRadius = new Setting<>(8);
+ 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.
*/
- public Setting rightClickContainerOnArrival = new Setting<>(true);
+ public final Setting rightClickContainerOnArrival = new Setting<>(true);
/**
* When running a goto towards a nether portal block, walk all the way into the portal
* instead of stopping one block before.
*/
- public Setting enterPortal = new Setting<>(true);
+ public final Setting enterPortal = new Setting<>(true);
/**
* Don't repropagate cost improvements below 0.01 ticks. They're all just floating point inaccuracies,
* and there's no point.
*/
- public Setting minimumImprovementRepropagation = new Setting<>(true);
+ public final Setting minimumImprovementRepropagation = new Setting<>(true);
/**
* After calculating a path (potentially through cached chunks), artificially cut it off to just the part that is
* entirely within currently loaded chunks. Improves path safety because cached chunks are heavily simplified.
+ *
+ * This is much safer to leave off now, and makes pathing more efficient. More explanation in the issue.
*
- * @see Issue #144
+ * @see Issue #114
*/
- public Setting cutoffAtLoadBoundary = new Setting<>(false);
+ public final Setting cutoffAtLoadBoundary = new Setting<>(false);
/**
* If a movement's cost increases by more than this amount between calculation and execution (due to changes
* in the environment / world), cancel and recalculate
*/
- public Setting maxCostIncrease = new Setting<>(10D);
+ public final Setting maxCostIncrease = new Setting<>(10D);
/**
* Stop 5 movements before anything that made the path COST_INF.
* For example, if lava has spread across the path, don't walk right up to it then recalculate, it might
* still be spreading lol
*/
- public Setting costVerificationLookahead = new Setting<>(5);
+ public final Setting costVerificationLookahead = new Setting<>(5);
/**
* Static cutoff factor. 0.9 means cut off the last 10% of all paths, regardless of chunk load state
*/
- public Setting pathCutoffFactor = new Setting<>(0.9);
+ public final Setting pathCutoffFactor = new Setting<>(0.9);
/**
* Only apply static cutoff for paths of at least this length (in terms of number of movements)
*/
- public Setting pathCutoffMinimumLength = new Setting<>(30);
+ public final Setting pathCutoffMinimumLength = new Setting<>(30);
/**
* Start planning the next path once the remaining movements tick estimates sum up to less than this value
*/
- public Setting planningTickLookAhead = new Setting<>(150);
+ public final Setting planningTickLookahead = new Setting<>(150);
/**
* Default size of the Long2ObjectOpenHashMap used in pathing
*/
- public Setting pathingMapDefaultSize = new Setting<>(1024);
+ public final Setting pathingMapDefaultSize = new Setting<>(1024);
/**
* Load factor coefficient for the Long2ObjectOpenHashMap used in pathing
*
* Decrease for faster map operations, but higher memory usage
*/
- public Setting pathingMapLoadFactor = new Setting<>(0.75f);
+ public final Setting pathingMapLoadFactor = new Setting<>(0.75f);
/**
* How far are you allowed to fall onto solid ground (without a water bucket)?
* 3 won't deal any damage. But if you just want to get down the mountain quickly and you have
* Feather Falling IV, you might set it a bit higher, like 4 or 5.
*/
- public Setting maxFallHeightNoWater = new Setting<>(3);
+ public final Setting maxFallHeightNoWater = new Setting<>(3);
/**
* How far are you allowed to fall onto solid ground (with a water bucket)?
* It's not that reliable, so I've set it below what would kill an unarmored player (23)
*/
- public Setting maxFallHeightBucket = new Setting<>(20);
+ public final Setting maxFallHeightBucket = new Setting<>(20);
/**
* Is it okay to sprint through a descend followed by a diagonal?
* The player overshoots the landing, but not enough to fall off. And the diagonal ensures that there isn't
* lava or anything that's !canWalkInto in that space, so it's technically safe, just a little sketchy.
+ *
+ * Note: this is *not* related to the allowDiagonalDescend setting, that is a completely different thing.
*/
- public Setting allowOvershootDiagonalDescend = new Setting<>(true);
+ public final Setting allowOvershootDiagonalDescend = new Setting<>(true);
/**
* If your goal is a GoalBlock in an unloaded chunk, assume it's far enough away that the Y coord
@@ -306,131 +409,157 @@ public class Settings {
* of considering the Y coord. The reasoning is that if your X and Z are 10,000 blocks away,
* your Y coordinate's accuracy doesn't matter at all until you get much much closer.
*/
- public Setting simplifyUnloadedYCoord = new Setting<>(true);
+ public final Setting simplifyUnloadedYCoord = new Setting<>(true);
/**
* If a movement takes this many ticks more than its initial cost estimate, cancel it
*/
- public Setting movementTimeoutTicks = new Setting<>(100);
+ public final Setting movementTimeoutTicks = new Setting<>(100);
/**
* Pathing ends after this amount of time, but only if a path has been found
*
* If no valid path (length above the minimum) has been found, pathing continues up until the failure timeout
*/
- public Setting primaryTimeoutMS = new Setting<>(500L);
+ public final Setting primaryTimeoutMS = new Setting<>(500L);
/**
* Pathing can never take longer than this, even if that means failing to find any path at all
*/
- public Setting failureTimeoutMS = new Setting<>(2000L);
+ public final Setting failureTimeoutMS = new Setting<>(2000L);
/**
* Planning ahead while executing a segment ends after this amount of time, but only if a path has been found
*
* If no valid path (length above the minimum) has been found, pathing continues up until the failure timeout
*/
- public Setting planAheadPrimaryTimeoutMS = new Setting<>(4000L);
+ public final Setting planAheadPrimaryTimeoutMS = new Setting<>(4000L);
/**
* Planning ahead while executing a segment can never take longer than this, even if that means failing to find any path at all
*/
- public Setting planAheadFailureTimeoutMS = new Setting<>(5000L);
+ public final Setting planAheadFailureTimeoutMS = new Setting<>(5000L);
/**
* For debugging, consider nodes much much slower
*/
- public Setting slowPath = new Setting<>(false);
+ public final Setting slowPath = new Setting<>(false);
/**
* Milliseconds between each node
*/
- public Setting slowPathTimeDelayMS = new Setting<>(100L);
+ public final Setting slowPathTimeDelayMS = new Setting<>(100L);
/**
* The alternative timeout number when slowPath is on
*/
- public Setting slowPathTimeoutMS = new Setting<>(40000L);
+ public final Setting slowPathTimeoutMS = new Setting<>(40000L);
/**
* The big one. Download all chunks in simplified 2-bit format and save them for better very-long-distance pathing.
*/
- public Setting chunkCaching = new Setting<>(true);
+ public final Setting chunkCaching = new Setting<>(true);
/**
* On save, delete from RAM any cached regions that are more than 1024 blocks away from the player
*
- * Temporarily disabled, see issue #248
+ * Temporarily disabled
+ *
+ * Temporarily reenabled
+ *
+ * @see Issue #248
*/
- public Setting pruneRegionsFromRAM = new Setting<>(false);
+ public final Setting pruneRegionsFromRAM = new Setting<>(true);
+
+ /**
+ * Remember the contents of containers (chests, echests, furnaces)
+ *
+ * Really buggy since the packet stuff is multithreaded badly thanks to brady
+ */
+ public final Setting containerMemory = new Setting<>(false);
+
+ /**
+ * Fill in blocks behind you
+ */
+ public final Setting backfill = new Setting<>(false);
/**
* Print all the debug messages to chat
*/
- public Setting chatDebug = new Setting<>(true);
+ public final Setting chatDebug = new Setting<>(false);
/**
* Allow chat based control of Baritone. Most likely should be disabled when Baritone is imported for use in
* something else
*/
- public Setting chatControl = new Setting<>(true);
+ public final Setting chatControl = new Setting<>(true);
/**
- * A second override over chatControl to force it on
+ * Some clients like Impact try to force chatControl to off, so here's a second setting to do it anyway
*/
- public Setting removePrefix = new Setting<>(false);
+ public final Setting chatControlAnyway = new Setting<>(false);
/**
* Render the path
*/
- public Setting renderPath = new Setting<>(true);
+ public final Setting renderPath = new Setting<>(true);
+
+ /**
+ * Render the path as a line instead of a frickin thingy
+ */
+ public final Setting renderPathAsLine = new Setting<>(false);
/**
* Render the goal
*/
- public Setting renderGoal = new Setting<>(true);
+ public final Setting renderGoal = new Setting<>(true);
+
+ /**
+ * Render selection boxes
+ */
+ public final Setting renderSelectionBoxes = new Setting<>(true);
/**
* Ignore depth when rendering the goal
*/
- public Setting renderGoalIgnoreDepth = new Setting<>(true);
+ public final Setting renderGoalIgnoreDepth = new Setting<>(true);
/**
* Renders X/Z type Goals with the vanilla beacon beam effect. Combining this with
* {@link #renderGoalIgnoreDepth} will cause strange render clipping.
*/
- public Setting renderGoalXZBeacon = new Setting<>(false);
+ public final Setting renderGoalXZBeacon = new Setting<>(false);
/**
* Ignore depth when rendering the selection boxes (to break, to place, to walk into)
*/
- public Setting renderSelectionBoxesIgnoreDepth = new Setting<>(true);
+ public final Setting renderSelectionBoxesIgnoreDepth = new Setting<>(true);
/**
* Ignore depth when rendering the path
*/
- public Setting renderPathIgnoreDepth = new Setting<>(true);
+ public final Setting renderPathIgnoreDepth = new Setting<>(true);
/**
* Line width of the path when rendered, in pixels
*/
- public Setting pathRenderLineWidthPixels = new Setting<>(5F);
+ public final Setting pathRenderLineWidthPixels = new Setting<>(5F);
/**
* Line width of the goal when rendered, in pixels
*/
- public Setting goalRenderLineWidthPixels = new Setting<>(3F);
+ public final Setting goalRenderLineWidthPixels = new Setting<>(3F);
/**
* Start fading out the path at 20 movements ahead, and stop rendering it entirely 30 movements ahead.
* Improves FPS.
*/
- public Setting fadePath = new Setting<>(false);
+ public final Setting fadePath = new Setting<>(false);
/**
* Move without having to force the client-sided rotations
*/
- public Setting freeLook = new Setting<>(true);
+ public final Setting freeLook = new Setting<>(true);
/**
* Will cause some minor behavioral differences to ensure that Baritone works on anticheats.
@@ -438,43 +567,241 @@ public class Settings {
* At the moment this will silently set the player's rotations when using freeLook so you're not sprinting in
* directions other than forward, which is picken up by more "advanced" anticheats like AAC, but not NCP.
*/
- public Setting antiCheatCompatibility = new Setting<>(true);
+ public final Setting antiCheatCompatibility = new Setting<>(true);
/**
* Exclusively use cached chunks for pathing
+ *
+ * Never turn this on
*/
- public Setting pathThroughCachedOnly = new Setting<>(false);
+ public final Setting pathThroughCachedOnly = new Setting<>(false);
/**
- * Whether or not to use the "#" command prefix
+ * Continue sprinting while in water
*/
- public Setting prefix = new Setting<>(false);
+ public final Setting sprintInWater = new Setting<>(true);
+
+ /**
+ * When GetToBlockProcess or MineProcess fails to calculate a path, instead of just giving up, mark the closest instance
+ * of that block as "unreachable" and go towards the next closest. GetToBlock expands this seaarch to the whole "vein"; MineProcess does not.
+ * This is because MineProcess finds individual impossible blocks (like one block in a vein that has gravel on top then lava, so it can't break)
+ * Whereas GetToBlock should blacklist the whole "vein" if it can't get to any of them.
+ */
+ public final Setting blacklistClosestOnFailure = new Setting<>(true);
+
+ /**
+ * 😎 Render cached chunks as semitransparent. Doesn't work with OptiFine 😭 Rarely randomly crashes, see this issue.
+ *
+ * Can be very useful on servers with low render distance. After enabling, you may need to reload the world in order for it to have an effect
+ * (e.g. disconnect and reconnect, enter then exit the nether, die and respawn, etc). This may literally kill your FPS and CPU because
+ * every chunk gets recompiled twice as much as normal, since the cached version comes into range, then the normal one comes from the server for real.
+ *
+ * Note that flowing water is cached as AVOID, which is rendered as lava. As you get closer, you may therefore see lava falls being replaced with water falls.
+ *
+ * SOLID is rendered as stone in the overworld, netherrack in the nether, and end stone in the end
+ */
+ public final Setting renderCachedChunks = new Setting<>(false);
+
+ /**
+ * 0.0f = not visible, fully transparent (instead of setting this to 0, turn off renderCachedChunks)
+ * 1.0f = fully opaque
+ */
+ public final Setting cachedChunksOpacity = new Setting<>(0.5f);
+
+ /**
+ * Whether or not to allow you to run Baritone commands with the prefix
+ */
+ public final Setting prefixControl = new Setting<>(true);
+
+ /**
+ * The command prefix for chat control
+ */
+ public final Setting prefix = new Setting<>("#");
+
+ /**
+ * Use a short Baritone prefix [B] instead of [Baritone] when logging to chat
+ */
+ public final Setting shortBaritonePrefix = new Setting<>(false);
+
+ /**
+ * Echo commands to chat when they are run
+ */
+ public final Setting echoCommands = new Setting<>(true);
+
+ /**
+ * Censor coordinates in goals and block positions
+ */
+ public final Setting censorCoordinates = new Setting<>(false);
+
+ /**
+ * Censor arguments to ran commands, to hide, for example, coordinates to #goal
+ */
+ public final Setting censorRanCommands = new Setting<>(false);
+
+ /**
+ * Always prefer silk touch tools over regular tools. This will not sacrifice speed, but it will always prefer silk
+ * touch tools over other tools of the same speed. This includes always choosing ANY silk touch tool over your hand.
+ */
+ public final Setting preferSilkTouch = new Setting<>(false);
/**
* Don't stop walking forward when you need to break blocks in your way
*/
- public Setting walkWhileBreaking = new Setting<>(true);
+ public final Setting walkWhileBreaking = new Setting<>(true);
/**
- * If we are more than 500 movements into the current path, discard the oldest segments, as they are no longer useful
+ * When a new segment is calculated that doesn't overlap with the current one, but simply begins where the current segment ends,
+ * splice it on and make a longer combined path. If this setting is off, any planned segment will not be spliced and will instead
+ * be the "next path" in PathingBehavior, and will only start after this one ends. Turning this off hurts planning ahead,
+ * because the next segment will exist even if it's very short.
+ *
+ * @see #planningTickLookahead
*/
- public Setting maxPathHistoryLength = new Setting<>(300);
+ public final Setting splicePath = new Setting<>(true);
+
+ /**
+ * If we are more than 300 movements into the current path, discard the oldest segments, as they are no longer useful
+ */
+ public final Setting maxPathHistoryLength = new Setting<>(300);
/**
* If the current path is too long, cut off this many movements from the beginning.
*/
- public Setting pathHistoryCutoffAmount = new Setting<>(50);
+ public final Setting pathHistoryCutoffAmount = new Setting<>(50);
/**
* Rescan for the goal once every 5 ticks.
* Set to 0 to disable.
*/
- public Setting mineGoalUpdateInterval = new Setting<>(5);
+ public final Setting mineGoalUpdateInterval = new Setting<>(5);
+
+ /**
+ * After finding this many instances of the target block in the cache, it will stop expanding outward the chunk search.
+ */
+ public final Setting maxCachedWorldScanCount = new Setting<>(10);
+
+ /**
+ * When GetToBlock doesn't know any locations for the desired block, explore randomly instead of giving up.
+ */
+ public final Setting exploreForBlocks = new Setting<>(true);
+
+ /**
+ * While exploring the world, offset the closest unloaded chunk by this much in both axes.
+ *
+ * This can result in more efficient loading, if you set this to the render distance.
+ */
+ public final Setting worldExploringChunkOffset = new Setting<>(0);
+
+ /**
+ * Take the 10 closest chunks, even if they aren't strictly tied for distance metric from origin.
+ */
+ public final Setting exploreChunkSetMinimumSize = new Setting<>(10);
+
+ /**
+ * Attempt to maintain Y coordinate while exploring
+ *
+ * -1 to disable
+ */
+ public final Setting exploreMaintainY = new Setting<>(64);
+
+ /**
+ * Replant normal Crops while farming and leave cactus and sugarcane to regrow
+ */
+ public final Setting replantCrops = new Setting<>(true);
+
+ /**
+ * Replant nether wart while farming. This setting only has an effect when replantCrops is also enabled
+ */
+ public final Setting replantNetherWart = new Setting<>(false);
+
+ /**
+ * When the cache scan gives less blocks than the maximum threshold (but still above zero), scan the main world too.
+ *
+ * Only if you have a beefy CPU and automatically mine blocks that are in cache
+ */
+ public final Setting extendCacheOnThreshold = new Setting<>(false);
+
+ /**
+ * Don't consider the next layer in builder until the current one is done
+ */
+ public final Setting buildInLayers = new Setting<>(false);
+
+ /**
+ * false = build from bottom to top
+ *
+ * true = build from top to bottom
+ */
+ public final Setting layerOrder = new Setting<>(false);
+
+ /**
+ * How far to move before repeating the build. 0 to disable repeating on a certain axis, 0,0,0 to disable entirely
+ */
+ public final Setting buildRepeat = new Setting<>(new Vec3i(0, 0, 0));
+
+ /**
+ * Allow standing above a block while mining it, in BuilderProcess
+ *
+ * Experimental
+ */
+ public final Setting breakFromAbove = new Setting<>(false);
+
+ /**
+ * As well as breaking from above, set a goal to up and to the side of all blocks to break.
+ *
+ * Never turn this on without also turning on breakFromAbove.
+ */
+ public final Setting goalBreakFromAbove = new Setting<>(false);
+
+ /**
+ * Build in map art mode, which makes baritone only care about the top block in each column
+ */
+ public final Setting mapArtMode = new Setting<>(false);
+
+ /**
+ * Override builder's behavior to not attempt to correct blocks that are currently water
+ */
+ public final Setting okIfWater = new Setting<>(false);
+
+ /**
+ * The set of incorrect blocks can never grow beyond this size
+ */
+ public final Setting incorrectSize = new Setting<>(100);
+
+ /**
+ * Multiply the cost of breaking a block that's correct in the builder's schematic by this coefficient
+ */
+ public final Setting breakCorrectBlockPenaltyMultiplier = new Setting<>(10d);
+
+ /**
+ * When this setting is true, build a schematic with the highest X coordinate being the origin, instead of the lowest
+ */
+ public final Setting schematicOrientationX = new Setting<>(false);
+
+ /**
+ * When this setting is true, build a schematic with the highest Y coordinate being the origin, instead of the lowest
+ */
+ public final Setting schematicOrientationY = new Setting<>(false);
+
+ /**
+ * When this setting is true, build a schematic with the highest Z coordinate being the origin, instead of the lowest
+ */
+ public final Setting schematicOrientationZ = new Setting<>(false);
+
+ /**
+ * Distance to scan every tick for updates. Expanding this beyond player reach distance (i.e. setting it to 6 or above)
+ * is only necessary in very large schematics where rescanning the whole thing is costly.
+ */
+ public final Setting builderTickScanRadius = new Setting<>(5);
/**
* While mining, should it also consider dropped items of the correct type as a pathing destination (as well as ore blocks)?
*/
- public Setting mineScanDroppedItems = new Setting<>(true);
+ public final Setting mineScanDroppedItems = new Setting<>(true);
+
+ /**
+ * Trim incorrect positions too far away, helps performance but hurts reliability in very large schematics
+ */
+ public final Setting distanceTrim = new Setting<>(true);
/**
* Cancel the current path if the goal has changed, and the path originally ended in the goal but doesn't anymore.
@@ -489,54 +816,78 @@ public class Settings {
*
* Also on cosmic prisons this should be set to true since you don't actually mine the ore it just gets replaced with stone.
*/
- public Setting cancelOnGoalInvalidation = new Setting<>(true);
+ public final Setting cancelOnGoalInvalidation = new Setting<>(true);
/**
* The "axis" command (aka GoalAxis) will go to a axis, or diagonal axis, at this Y level.
*/
- public Setting axisHeight = new Setting<>(120);
+ public final Setting axisHeight = new Setting<>(120);
/**
- * Allow MineBehavior to use X-Ray to see where the ores are. Turn this option off to force it to mine "legit"
- * where it will only mine an ore once it can actually see it, so it won't do or know anything that a normal player
- * couldn't. If you don't want it to look like you're X-Raying, turn this off
+ * Disconnect from the server upon arriving at your goal
*/
- public Setting legitMine = new Setting<>(false);
+ public final Setting disconnectOnArrival = new Setting<>(false);
+
+ /**
+ * Disallow MineBehavior from using X-Ray to see where the ores are. Turn this option on to force it to mine "legit"
+ * where it will only mine an ore once it can actually see it, so it won't do or know anything that a normal player
+ * couldn't. If you don't want it to look like you're X-Raying, turn this on
+ */
+ public final Setting legitMine = new Setting<>(false);
/**
* What Y level to go to for legit strip mining
*/
- public Setting legitMineYLevel = new Setting<>(11);
+ public final Setting legitMineYLevel = new Setting<>(11);
+
+ /**
+ * Magically see ores that are separated diagonally from existing ores. Basically like mining around the ores that it finds
+ * in case there's one there touching it diagonally, except it checks it un-legit-ly without having the mine blocks to see it.
+ * You can decide whether this looks plausible or not.
+ *
+ * This is disabled because it results in some weird behavior. For example, it can """see""" the top block of a vein of iron_ore
+ * through a lava lake. This isn't an issue normally since it won't consider anything touching lava, so it just ignores it.
+ * However, this setting expands that and allows it to see the entire vein so it'll mine under the lava lake to get the iron that
+ * it can reach without mining blocks adjacent to lava. This really defeats the purpose of legitMine since a player could never
+ * do that lol, so thats one reason why its disabled
+ */
+ public final Setting legitMineIncludeDiagonals = new Setting<>(false);
/**
* When mining block of a certain type, try to mine two at once instead of one.
* If the block above is also a goal block, set GoalBlock instead of GoalTwoBlocks
* If the block below is also a goal block, set GoalBlock to the position one down instead of GoalTwoBlocks
*/
- public Setting forceInternalMining = new Setting<>(true);
+ public final Setting forceInternalMining = new Setting<>(true);
/**
* Modification to the previous setting, only has effect if forceInternalMining is true
* If true, only apply the previous setting if the block adjacent to the goal isn't air.
*/
- public Setting internalMiningAirException = new Setting<>(true);
+ public final Setting internalMiningAirException = new Setting<>(true);
/**
* The actual GoalNear is set this distance away from the entity you're following
*
* For example, set followOffsetDistance to 5 and followRadius to 0 to always stay precisely 5 blocks north of your follow target.
*/
- public Setting followOffsetDistance = new Setting<>(0D);
+ public final Setting