diff --git a/src/main/java/dev/enjarai/trickster/spell/execution/executor/DefaultSpellExecutor.java b/src/main/java/dev/enjarai/trickster/spell/execution/executor/DefaultSpellExecutor.java index 5f10d4b1..c6542d14 100644 --- a/src/main/java/dev/enjarai/trickster/spell/execution/executor/DefaultSpellExecutor.java +++ b/src/main/java/dev/enjarai/trickster/spell/execution/executor/DefaultSpellExecutor.java @@ -23,7 +23,7 @@ public class DefaultSpellExecutor implements SpellExecutor { SpellInstruction.STACK_ENDEC.fieldOf("instructions", e -> e.instructions), Fragment.ENDEC.listOf().fieldOf("inputs", e -> e.inputs), Endec.INT.listOf().fieldOf("scope", e -> e.scope), - ExecutionState.ENDEC.fieldOf("state", DefaultSpellExecutor::getDeepestState), + ExecutionState.ENDEC.fieldOf("state", e -> e.state), EndecTomfoolery.safeOptionalOf(SpellExecutor.ENDEC).optionalFieldOf("child", e -> e.child, Optional.empty()), EndecTomfoolery.safeOptionalOf(Fragment.ENDEC).optionalFieldOf("override_return_value", e -> e.overrideReturnValue, Optional.empty()), DefaultSpellExecutor::new diff --git a/src/main/java/dev/enjarai/trickster/spell/execution/executor/FoldingSpellExecutor.java b/src/main/java/dev/enjarai/trickster/spell/execution/executor/FoldingSpellExecutor.java index dcaacb9e..ac068aa3 100644 --- a/src/main/java/dev/enjarai/trickster/spell/execution/executor/FoldingSpellExecutor.java +++ b/src/main/java/dev/enjarai/trickster/spell/execution/executor/FoldingSpellExecutor.java @@ -29,8 +29,8 @@ public class FoldingSpellExecutor implements SpellExecutor { EndecTomfoolery.safeOptionalOf(SpellExecutor.ENDEC).fieldOf("child", e -> e.child), FoldingSpellExecutor::new ), StructEndecBuilder.of( // <=2.0.0-beta.1 compat - ExecutionState.ENDEC.fieldOf("state", FoldingSpellExecutor::getDeepestState), - SpellPart.ENDEC.fieldOf("executable", FoldingSpellExecutor::spell), + ExecutionState.ENDEC.fieldOf("state", e -> e.state), + SpellPart.ENDEC.fieldOf("executable", e -> e.executable), ListFragment.ENDEC.fieldOf("list", e -> (ListFragment) e.previous), EndecTomfoolery.stackOf(Fragment.ENDEC).fieldOf("elements", executor -> executor.values), EndecTomfoolery.safeOptionalOf(SpellExecutor.ENDEC).optionalFieldOf("child", executor -> executor.child, Optional.empty()),