|
1 | 1 | package gay.object.hexdebug.mixin; |
2 | 2 |
|
3 | | -import at.petrak.hexcasting.api.casting.castables.Action; |
4 | | -import at.petrak.hexcasting.api.casting.eval.CastingEnvironment; |
5 | | -import at.petrak.hexcasting.api.casting.eval.OperationResult; |
6 | | -import at.petrak.hexcasting.api.casting.eval.vm.CastingImage; |
7 | | -import at.petrak.hexcasting.api.casting.eval.vm.SpellContinuation; |
8 | | -import at.petrak.hexcasting.api.casting.iota.Iota; |
9 | | -import at.petrak.hexcasting.common.casting.actions.eval.OpEval; |
10 | | -import gay.object.hexdebug.casting.eval.IDebugCastEnv; |
| 3 | + |
| 4 | +import at.petrak.hexcasting.api.spell.Action; |
| 5 | +import at.petrak.hexcasting.api.spell.OperationResult; |
| 6 | +import at.petrak.hexcasting.api.spell.casting.CastingContext; |
| 7 | +import at.petrak.hexcasting.api.spell.casting.eval.SpellContinuation; |
| 8 | +import at.petrak.hexcasting.api.spell.iota.Iota; |
| 9 | +import at.petrak.hexcasting.common.casting.operators.eval.OpEval; |
| 10 | +import gay.object.hexdebug.casting.eval.IMixinCastingContext; |
11 | 11 | import gay.object.hexdebug.debugger.DebugStepType; |
12 | 12 | import org.spongepowered.asm.mixin.Mixin; |
13 | 13 | import org.spongepowered.asm.mixin.injection.At; |
|
16 | 16 |
|
17 | 17 | import java.util.List; |
18 | 18 |
|
| 19 | + |
19 | 20 | @Mixin(OpEval.class) |
20 | 21 | public abstract class MixinOpEval implements Action { |
21 | | - @Inject(method = "exec", at = @At("RETURN"), remap = false) |
| 22 | + @SuppressWarnings("UnreachableCode") |
| 23 | + @Inject(method = "operate", at = @At("RETURN"), remap = false) |
22 | 24 | private void setDebugStepType( |
23 | | - CastingEnvironment env, |
24 | | - CastingImage image, |
25 | | - SpellContinuation continuation, |
26 | | - List<Iota> newStack, |
27 | | - Iota iota, |
28 | | - CallbackInfoReturnable<OperationResult> cir |
| 25 | + SpellContinuation continuation, |
| 26 | + List<Iota> stack, |
| 27 | + Iota ravenmind, |
| 28 | + CastingContext ctx, |
| 29 | + CallbackInfoReturnable<OperationResult> cir |
29 | 30 | ) { |
30 | | - if (env instanceof IDebugCastEnv debugCastEnv) { |
31 | | - debugCastEnv.setLastEvaluatedAction(this); |
32 | | - debugCastEnv.setLastDebugStepType(DebugStepType.IN); |
| 31 | + var debugCastEnv = (IMixinCastingContext) (Object) ctx; |
| 32 | + if (debugCastEnv != null) { |
| 33 | + debugCastEnv.setLastEvaluatedAction$hexdebug(this); |
| 34 | + debugCastEnv.setLastDebugStepType$hexdebug(DebugStepType.IN); |
33 | 35 | } |
34 | 36 | } |
35 | 37 | } |
0 commit comments