Skip to content

Commit 0ef5565

Browse files
committed
dont simulate fluid filling placements in break sim. The place sim already does that if its required
1 parent da11b6b commit 0ef5565

File tree

5 files changed

+3
-4
lines changed

5 files changed

+3
-4
lines changed

src/main/kotlin/com/lambda/config/AutomationConfig.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@ open class AutomationConfig(
7979
val showAllEntries by setting("Show All Entries", false, "Show all entries in the task tree").group(Group.Debug)
8080
val shrinkFactor by setting("Shrink Factor", 0.001, 0.0..1.0, 0.001).group(Group.Debug)
8181
val ignoreItemDropWarnings by setting("Ignore Drop Warnings", false, "Hides the item drop warnings from the break manager").group(Group.Debug)
82-
val maxSimDependencies by setting("Max Sim Dependencies", 3, 0..10, 1, "Maximum dependency build results").group(Group.Debug)
8382

8483
@Volatile
8584
var drawables = listOf<Drawable>()

src/main/kotlin/com/lambda/config/groups/BuildConfig.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ interface BuildConfig {
2929
val interactionsPerTick: Int
3030
val maxPendingInteractions: Int
3131
val interactionTimeout: Int
32+
val maxBuildDependencies: Int
3233

3334
val useDefaultReach: Boolean
3435
val attackReach: Double

src/main/kotlin/com/lambda/config/groups/BuildSettings.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ class BuildSettings(
4040
override val interactionsPerTick by c.setting("Interactions Per Tick", 5, 1..30, 1, "The amount of interactions that can happen per tick").group(baseGroup, Group.General).index()
4141
override val maxPendingInteractions by c.setting("Max Pending Interactions", 15, 1..30, 1, "The maximum count of pending interactions to allow before pausing future interactions").group(baseGroup, Group.General).index()
4242
override val interactionTimeout by c.setting("Interaction Timeout", 10, 1..30, 1, "Timeout for block breaks in ticks", unit = " ticks").group(baseGroup, Group.General).index()
43+
override val maxBuildDependencies by c.setting("Max Sim Dependencies", 3, 0..10, 1, "Maximum dependency build results").group(baseGroup, Group.General).index()
4344

4445
override val useDefaultReach by c.setting("Default Reach", true, "Whether to use vanilla interaction ranges").group(baseGroup, Group.Reach).index()
4546
override val attackReach by c.setting("Attack Reach", DEFAULT_ATTACK_REACH, 1.0..10.0, 0.01, "Maximum entity interaction distance") { !useDefaultReach }.group(baseGroup, Group.Reach).index()

src/main/kotlin/com/lambda/interaction/construction/simulation/Sim.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717

1818
package com.lambda.interaction.construction.simulation
1919

20-
import com.lambda.config.AutomationConfig
2120
import com.lambda.interaction.construction.processing.PreProcessingInfo
2221
import com.lambda.interaction.construction.result.BuildResult
2322
import com.lambda.interaction.construction.result.results.GenericResult
@@ -77,7 +76,7 @@ abstract class Sim<T : BuildResult> : Results<T> {
7776
*/
7877
protected suspend fun ISimInfo.withDependent(dependent: Sim<*>, block: suspend () -> Unit) {
7978
// +1 because the build sim counts as a dependent
80-
if (dependencyStack.size >= AutomationConfig.Companion.DEFAULT.maxSimDependencies + 1) return
79+
if (dependencyStack.size >= buildConfig.maxBuildDependencies + 1) return
8180
dependencyStack.push(dependent)
8281
block()
8382
dependencyStack.pop()

src/main/kotlin/com/lambda/interaction/construction/simulation/checks/BreakSim.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,6 @@ class BreakSim private constructor(simInfo: ISimInfo)
277277

278278
affectedFluids.forEach { (liquidPos, liquidState) ->
279279
result(BreakResult.Submerge(liquidPos, liquidState))
280-
sim(liquidPos, liquidState, TargetState.Solid(emptySet())) { simPlacement() }
281280
}
282281
result(BreakResult.BlockedByFluid(pos, state, affectedFluids.keys))
283282
return true

0 commit comments

Comments
 (0)