Skip to content

Commit c64e5d7

Browse files
queueExecuteAndWrapIotas: allow specifying continuation (#965)
2 parents 22b7a6f + 4fd9ca4 commit c64e5d7

File tree

1 file changed

+4
-2
lines changed
  • Common/src/main/java/at/petrak/hexcasting/api/casting/eval/vm

1 file changed

+4
-2
lines changed

Common/src/main/java/at/petrak/hexcasting/api/casting/eval/vm/CastingVM.kt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,11 @@ class CastingVM(var image: CastingImage, val env: CastingEnvironment) {
3838
*
3939
* Mutates this
4040
*/
41-
fun queueExecuteAndWrapIotas(iotas: List<Iota>, world: ServerLevel): ExecutionClientView {
41+
@JvmOverloads
42+
fun queueExecuteAndWrapIotas(iotas: List<Iota>, world: ServerLevel, nextContinuation: SpellContinuation = SpellContinuation.Done): ExecutionClientView {
4243
// Initialize the continuation stack to a single top-level eval for all iotas.
43-
var continuation = SpellContinuation.Done.pushFrame(FrameEvaluate(SpellList.LList(0, iotas), false))
44+
// HACK: Ideally, we'd have a separate (SpellContinuation, ServerWorld) overload, but then 0.11.3 would cause mixins to break. Look into properly splitting this in 1.21?
45+
var continuation = if (iotas.isNotEmpty()) nextContinuation.pushFrame(FrameEvaluate(SpellList.LList(0, iotas), false)) else nextContinuation;
4446
// Begin aggregating info
4547
val info = TempControllerInfo(earlyExit = false)
4648
var lastResolutionType = ResolvedPatternType.UNRESOLVED

0 commit comments

Comments
 (0)