Skip to content

Commit 3af24f1

Browse files
committed
small fixes / cleanup
1 parent e65a2d1 commit 3af24f1

3 files changed

Lines changed: 13 additions & 9 deletions

File tree

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ class BuildSettings(
3333
Scan("Scan")
3434
}
3535

36-
override val breakBlocks by c.setting("Break", true, "Break blocks")
37-
override val interactBlocks by c.setting("Place / Interact", true, "Interact blocks")
36+
override val breakBlocks by c.setting("Break", true, "Break blocks").group(baseGroup, Group.General).index()
37+
override val interactBlocks by c.setting("Place / Interact", true, "Interact blocks").group(baseGroup, Group.General).index()
3838

3939
override val pathing by c.setting("Pathing", true, "Path to blocks").group(baseGroup, Group.General).index()
4040
override val stayInRange by c.setting("Stay In Range", true, "Stay in range of blocks").group(baseGroup, Group.General).index()

‎src/main/kotlin/com/lambda/interaction/construction/simulation/SimInfo.kt‎

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ interface SimInfo : Automated {
6868
pov,
6969
Stack(),
7070
concurrentResults
71-
)?.takeIf { it.hasBasicRequirements() }?.sim()
71+
).takeIf { it.hasBasicRequirements() }?.sim()
7272

7373
/**
7474
* Creates a new [SimInfo] using the current [SimInfo]'s [dependencyStack] and [concurrentResults],
@@ -89,7 +89,7 @@ interface SimInfo : Automated {
8989
pov,
9090
Stack<Sim<*>>().apply { addAll(dependencyStack) },
9191
concurrentResults
92-
)?.takeIf { it.hasBasicRequirements() }?.sim()
92+
).takeIf { it.hasBasicRequirements() }?.sim()
9393

9494
@SimDsl
9595
private fun AutomatedSafeContext.getTypedInfo(
@@ -99,10 +99,10 @@ interface SimInfo : Automated {
9999
pov: Vec3d,
100100
dependencyStack: Stack<Sim<*>>,
101101
concurrentResults: MutableSet<BuildResult>
102-
): SimInfo? =
102+
): SimInfo {
103103
if (!targetState.isEmpty()) {
104104
getProcessingInfo(state, targetState, pos)?.let { preProcessing ->
105-
object : InteractSimInfo, Automated by this {
105+
return object : InteractSimInfo, Automated by this {
106106
override val pos = pos
107107
override val state = state
108108
override val targetState = targetState
@@ -121,7 +121,9 @@ interface SimInfo : Automated {
121121
expectedState.matches(state, if (!completely) preProcessing.info.ignore else emptySet())
122122
}
123123
}
124-
} else object : BreakSimInfo, Automated by this {
124+
}
125+
126+
return object : BreakSimInfo, Automated by this {
125127
override val pos = pos
126128
override val state = state
127129
override val targetState = targetState
@@ -132,6 +134,7 @@ interface SimInfo : Automated {
132134
context(_: AutomatedSafeContext, _: Sim<*>)
133135
override suspend fun sim() = simBreak()
134136
}
137+
}
135138
}
136139
}
137140

‎src/main/kotlin/com/lambda/task/tasks/BuildTask.kt‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,11 +128,12 @@ class BuildTask private constructor(
128128
val viableResults = results
129129
.filter { result ->
130130
val finalResult = (result as? Dependent)?.lastDependency ?: result
131-
pendingInteractions.none { it.blockPos == result.pos } &&
131+
pendingInteractions.none { it.blockPos == finalResult.pos } &&
132+
(finalResult !is Contextual ||
132133
when (finalResult) {
133134
is BreakResult -> buildConfig.breakBlocks
134135
else -> buildConfig.interactBlocks
135-
}
136+
})
136137
}
137138
.sorted()
138139

0 commit comments

Comments
 (0)