Skip to content

Commit 5ec4524

Browse files
committed
Maybe fix MixinOpEval
1 parent 37c327c commit 5ec4524

File tree

1 file changed

+20
-18
lines changed

1 file changed

+20
-18
lines changed
Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
package gay.object.hexdebug.mixin;
22

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;
1111
import gay.object.hexdebug.debugger.DebugStepType;
1212
import org.spongepowered.asm.mixin.Mixin;
1313
import org.spongepowered.asm.mixin.injection.At;
@@ -16,20 +16,22 @@
1616

1717
import java.util.List;
1818

19+
1920
@Mixin(OpEval.class)
2021
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)
2224
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
2930
) {
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);
3335
}
3436
}
3537
}

0 commit comments

Comments
 (0)