Skip to content

Commit

Permalink
Update Baritone to 1.2.17 (#504)
Browse files Browse the repository at this point in the history
* updated baritone proof of concept

* Use updated official baritone maven

* set baritone versions as "changing"

* Add more Baritone settings to configure
  • Loading branch information
rfresh2 committed Feb 28, 2023
1 parent 7b505a3 commit 90d5575
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 8 deletions.
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,10 @@ dependencies {
compileOnly 'org.jetbrains:annotations:23.0.0'

// This Baritone will NOT be included in the jar
implementation 'com.github.cabaletta:baritone:1.2.14'
implementation('cabaletta:baritone-deobf-unoptimized-mcp-dev:1.2').setChanging(true)

// This Baritone WILL be included in the jar
jarLibs 'cabaletta:baritone-api:1.2'
jarLibs('cabaletta:baritone-api:1.2').setChanging(true)

// Add everything in jarLibs to implementation (compile)
implementation configurations.jarLibs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ object Baritone : Module(
private val allowDownwardTunneling by setting("Downward Tunneling", true, { page == Page.BASIC }, description = "Allow mining blocks directly beneath you.")
private val allowParkour by setting("Allow Parkour", true, { page == Page.BASIC })
private val allowParkourPlace by setting("Allow Parkour Place", true, { allowParkour && page == Page.BASIC })
private val buildInLayers by setting("Build In Layers", false, { page == Page.BASIC }, description = "Build/mine one layer at a time in schematics and selections.")
private val layerOrder by setting("Top To Bottom", false, { buildInLayers && page == Page.BASIC }, description = "Build/mine from top to bottom in schematics and selections.")

/* Visual */
private val freeLook by setting("Free Look", true, { page == Page.VISUAL }, description = "Move without having to force the client-sided rotations.")
Expand All @@ -50,6 +48,22 @@ object Baritone : Module(
private val allowWaterBucketFall by setting("Water Bucket Clutch", true, { page == Page.FALL }, description = "Uses a water bucket to get down quickly.")
private val maxFallHeightBucket by setting("Max Bucket Height", 20, 10..250, 10, { allowWaterBucketFall && page == Page.FALL }, description = "Max height that baritone can use a water bucket.")

/* Build */
private val buildInLayers by setting("Build In Layers", false, { page == Page.BUILD }, description = "Build/mine one layer at a time in schematics and selections.")
private val layerOrder by setting("Top To Bottom", false, { buildInLayers && page == Page.BUILD }, description = "Build/mine from top to bottom in schematics and selections.")
private val startAtLayer by setting("Start At Layer", 0, 0..256, 1, visibility = { buildInLayers && page == Page.BUILD }, description = "Start building the schematic at a specific layer.")
private val layerHeight by setting("Layer Height", 1, 1..50, 1, visibility = { buildInLayers && page == Page.BUILD }, description = "How high should the individual layers be?")
private val skipFailedLayers by setting("Skip Failed Layers", false, { buildInLayers && page == Page.BUILD }, description = "If a layer is unable to be constructed, just skip it.")
private val buildOnlySelection by setting("Build Only Selection", false, { page == Page.BUILD }, description = "Only build the selected part of schematics")
private val buildIgnoreExisting by setting("Build Ignore Existing", false, { page == Page.BUILD }, description = "If this is true, the builder will treat all non-air blocks as correct. It will only place new blocks.")
private val buildIgnoreDirection by setting("Build Ignore Direction", false, { page == Page.BUILD }, description = "If this is true, the builder will ignore directionality of certain blocks like glazed terracotta.")
private val mapArtMode by setting("Map Art Mode", false, { page == Page.BUILD }, description = "Build in map art mode, which makes baritone only care about the top block in each column")
private val schematicOrientationX by setting("Schematic Orientation X", false, { page == Page.BUILD }, description = "When this setting is true, build a schematic with the highest X coordinate being the origin, instead of the lowest")
private val schematicOrientationY by setting("Schematic Orientation Y", false, { page == Page.BUILD }, description = "When this setting is true, build a schematic with the highest Y coordinate being the origin, instead of the lowest")
private val schematicOrientationZ by setting("Schematic Orientation Z", false, { page == Page.BUILD }, description = "When this setting is true, build a schematic with the highest Z coordinate being the origin, instead of the lowest")
private val okIfWater by setting("Ok If Water", false, { page == Page.BUILD }, description = "Override builder's behavior to not attempt to correct blocks that are currently water")
private val incorrectSize by setting("Incorrect Size", 100, 1..1000, 1, { page == Page.BUILD }, description = "The set of incorrect blocks can never grow beyond this size")

/* Advanced */
private val blockReachDistance by setting("Reach Distance", 4.5f, 1.0f..10.0f, 0.5f, { page == Page.ADVANCED }, description = "Max distance baritone can place blocks.")
private val enterPortals by setting("Enter Portals", true, { page == Page.ADVANCED }, description = "Baritone will walk all the way into the portal, instead of stopping one block before.")
Expand All @@ -62,9 +76,19 @@ object Baritone : Module(
private val mobAvoidanceCoefficient by setting("Mob Avoidance Coefficient", 1.5f, 0f..5f, 0.5f, visibility = { avoidance && page == Page.ADVANCED }, description = "Set to 1.0 to effectively disable this feature. Set below 1.0 to go out of your way to walk near mobs.")
private val mobSpawnerAvoidanceRadius by setting("Mob Spawner Avoidance Radius", 10, 0..60, 10, visibility = { avoidance && page == Page.ADVANCED }, description = "Distance to avoid mob spawners.")
private val mobSpawnerAvoidanceCoefficient by setting("Mob Spawner Avoidance Coefficient", 1.5f, 0f..5f, 0.5f, visibility = { avoidance && page == Page.ADVANCED }, description = "Set to 1.0 to effectively disable this feature. Set below 1.0 to go out of your way to walk near mob spawners.")
private val preferSilkTouch by setting("Prefer Silk Touch", false, { page == Page.ADVANCED }, description = "Always prefer silk touch tools over regular tools.")
private val backfill by setting("Backfill", false, { page == Page.ADVANCED }, description = "Fill in blocks behind you")
private val chunkCaching by setting("Chunk Caching", true, { page == Page.ADVANCED }, description = "Download all chunks in simplified 2-bit format and save them for better very-long-distance pathing.")
private val assumeStep by setting("Assume Step", false, { page == Page.ADVANCED }, description = "Assume step functionality; don't jump on an Ascend.")
private val assumeExternalAutoTool by setting("Assume External AutoTool", false, { page == Page.ADVANCED }, description = "Disable baritone's auto-tool at runtime, but still assume that another mod will provide auto tool functionality")
private val autoTool by setting("AutoTool", true, { page == Page.ADVANCED }, description = "Automatically select the best available tool")
private val assumeSafeWalk by setting("Assume Safe Walk", false, { page == Page.ADVANCED }, description = "Assume safe walk functionality; don't sneak on a backplace traverse.")
private val allowJumpAt256 by setting("Allow Jump At 256", false, { page == Page.ADVANCED }, description = "If true, parkour is allowed to make jumps when standing on blocks at the maximum height, so player feet is y=256")
private val allowDiagonalDescend by setting("Allow Diagonal Descend", false, { page == Page.ADVANCED }, description = "Allow descending diagonally. Safer than allowParkour yet still slightly unsafe, can make contact with unchecked adjacent blocks, so it's unsafe in the nether.")
private val allowDiagonalAscend by setting("Allow Diagonal Ascend", false, { page == Page.ADVANCED }, description = "Allow diagonal ascending. Actually pretty safe, much safer than diagonal descend tbh")

private enum class Page {
BASIC, VISUAL, FALL, ADVANCED
BASIC, VISUAL, FALL, BUILD, ADVANCED
}

init {
Expand Down Expand Up @@ -105,14 +129,12 @@ object Baritone : Module(
it.chatControl.value = false // enable chatControlAnyway if you want to use it
/* Basic */
it.allowBreak.value = allowBreak
it.allowPlace.value = allowPlace
it.allowSprint.value = allowSprint
it.allowPlace.value = allowPlace
it.allowInventory.value = allowInventory
it.allowDownward.value = allowDownwardTunneling
it.allowParkour.value = allowParkour
it.allowParkourPlace.value = allowParkourPlace
it.buildInLayers.value = buildInLayers
it.layerOrder.value = layerOrder
/* Visual */
it.freeLook.value = freeLook
it.renderGoal.value = renderGoal
Expand All @@ -122,12 +144,37 @@ object Baritone : Module(
it.maxFallHeightNoWater.value = maxFallHeightNoWater
it.allowWaterBucketFall.value = allowWaterBucketFall
it.maxFallHeightBucket.value = maxFallHeightBucket
/* Build */
it.buildInLayers.value = buildInLayers
it.layerOrder.value = layerOrder
it.layerHeight.value = layerHeight
it.startAtLayer.value = startAtLayer
it.skipFailedLayers.value = skipFailedLayers
it.buildOnlySelection.value = buildOnlySelection
it.buildIgnoreExisting.value = buildIgnoreExisting
it.buildIgnoreDirection.value = buildIgnoreDirection
it.mapArtMode.value = mapArtMode
it.schematicOrientationX.value = schematicOrientationX
it.schematicOrientationY.value = schematicOrientationY
it.schematicOrientationZ.value = schematicOrientationZ
it.okIfWater.value = okIfWater
it.incorrectSize.value = incorrectSize
/* Advanced */
it.preferSilkTouch.value = preferSilkTouch
it.backfill.value = backfill
it.chunkCaching.value = chunkCaching
it.blockReachDistance.value = blockReachDistance
it.enterPortal.value = enterPortals
it.blockPlacementPenalty.value = blockPlacementPenalty.toDouble()
it.jumpPenalty.value = jumpPenalty.toDouble()
it.assumeWalkOnWater.value = assumeWalkOnWater
it.assumeStep.value = assumeStep
it.assumeExternalAutoTool.value = assumeExternalAutoTool
it.autoTool.value = autoTool
it.assumeSafeWalk.value = assumeSafeWalk
it.allowJumpAt256.value = allowJumpAt256
it.allowDiagonalDescend.value = allowDiagonalDescend
it.allowDiagonalAscend.value = allowDiagonalAscend
it.failureTimeoutMS.value = failureTimeout * 1000L
it.avoidance.value = avoidance
it.mobAvoidanceRadius.value = mobAvoidanceRadius
Expand Down

0 comments on commit 90d5575

Please sign in to comment.