Class DebugEnvironment
java.lang.Object
gay.object.hexdebug.core.api.debugging.DebugEnvironment
- Direct Known Subclasses:
BaseCircleDebugEnv,SimplePlayerBasedDebugEnv
Like
CastingEnvironment, but for debugging.-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedDebugEnvironment(@NotNull net.minecraft.server.level.ServerPlayer caster) -
Method Summary
Modifier and TypeMethodDescription@NotNull net.minecraft.server.level.ServerPlayer@Nullable DebugStepType@Nullable at.petrak.hexcasting.api.casting.castables.Actionabstract @NotNull net.minecraft.network.chat.ComponentgetName()Returns a display name for this debug session.@NotNull UUIDabstract booleanFor in-world debugees, returns whether the caster is close enough to the debuggee to allow debug-related actions to be performed (eg.booleanvoidprintDebugMessage(@NotNull net.minecraft.network.chat.Component message) voidprintDebugMessage(@NotNull net.minecraft.network.chat.Component message, @NotNull DebugOutputCategory category) voidprintDebugMessage(@NotNull net.minecraft.network.chat.Component message, @NotNull DebugOutputCategory category, boolean withSource) voidprintDebugMishap(@NotNull at.petrak.hexcasting.api.casting.eval.CastingEnvironment env, at.petrak.hexcasting.api.casting.eval.sideeffects.OperatorSideEffect.DoMishap sideEffect) abstract voidrestart(int threadId) Attempts to restart the debuggee on the given debug thread.abstract booleanresume(@NotNull at.petrak.hexcasting.api.casting.eval.CastingEnvironment env, @NotNull at.petrak.hexcasting.api.casting.eval.vm.CastingImage image, @NotNull at.petrak.hexcasting.api.casting.eval.ResolvedPatternType resolutionType) Attempts to resume execution of the debuggee.voidsetLastDebugStepType(@Nullable DebugStepType lastDebugStepType) voidsetLastEvaluatedAction(@Nullable at.petrak.hexcasting.api.casting.castables.Action lastEvaluatedAction) abstract voidTerminates the debuggee.
-
Constructor Details
-
DebugEnvironment
protected DebugEnvironment(@NotNull @NotNull net.minecraft.server.level.ServerPlayer caster)
-
-
Method Details
-
resume
public abstract boolean resume(@NotNull @NotNull at.petrak.hexcasting.api.casting.eval.CastingEnvironment env, @NotNull @NotNull at.petrak.hexcasting.api.casting.eval.vm.CastingImage image, @NotNull @NotNull at.petrak.hexcasting.api.casting.eval.ResolvedPatternType resolutionType) Attempts to resume execution of the debuggee. This is called by the debugger after the current continuation is successfully evaluated to completion.- Returns:
- true if the debug session can continue, or false if the debuggee should be terminated
-
restart
public abstract void restart(int threadId) Attempts to restart the debuggee on the given debug thread. This is called by the debugger when requested by the user.
The previous debug thread is removed before this method is called, so the implementation may useHexDebugCoreAPI.createDebugThread(gay.object.hexdebug.core.api.debugging.DebugEnvironment, java.lang.Integer)andHexDebugCoreAPI.startDebuggingIotas(gay.object.hexdebug.core.api.debugging.DebugEnvironment, at.petrak.hexcasting.api.casting.eval.CastingEnvironment, java.util.List<at.petrak.hexcasting.api.casting.iota.Iota>, at.petrak.hexcasting.api.casting.eval.vm.CastingImage). However, note thatDebugEnvironmentis not called before this method, so it's up to the implementation whether they need to call that or not. -
terminate
public abstract void terminate()Terminates the debuggee. This is called by the debugger afterresume(at.petrak.hexcasting.api.casting.eval.CastingEnvironment, at.petrak.hexcasting.api.casting.eval.vm.CastingImage, at.petrak.hexcasting.api.casting.eval.ResolvedPatternType)returnsfalse, duringHexDebugCoreAPI.terminateDebugThread(gay.object.hexdebug.core.api.debugging.DebugEnvironment), or when requested by the user. -
isCasterInRange
@Contract(pure=true) public abstract boolean isCasterInRange()For in-world debugees, returns whether the caster is close enough to the debuggee to allow debug-related actions to be performed (eg. pause, step, restart). -
getName
@Contract(pure=true) @NotNull public abstract @NotNull net.minecraft.network.chat.Component getName()Returns a display name for this debug session.
For example, debugger items return the name of the item, and spell circles return the name of the impetus. -
printDebugMessage
public void printDebugMessage(@NotNull @NotNull net.minecraft.network.chat.Component message) -
printDebugMessage
public void printDebugMessage(@NotNull @NotNull net.minecraft.network.chat.Component message, @NotNull @NotNull DebugOutputCategory category) -
printDebugMessage
public void printDebugMessage(@NotNull @NotNull net.minecraft.network.chat.Component message, @NotNull @NotNull DebugOutputCategory category, boolean withSource) -
printDebugMishap
public void printDebugMishap(@NotNull @NotNull at.petrak.hexcasting.api.casting.eval.CastingEnvironment env, @NotNull at.petrak.hexcasting.api.casting.eval.sideeffects.OperatorSideEffect.DoMishap sideEffect) -
isDebugging
@Contract(pure=true) public boolean isDebugging() -
getCaster
@NotNull public @NotNull net.minecraft.server.level.ServerPlayer getCaster() -
getSessionId
-
getLastDebugStepType
-
setLastDebugStepType
-
getLastEvaluatedAction
@Internal @Nullable public @Nullable at.petrak.hexcasting.api.casting.castables.Action getLastEvaluatedAction() -
setLastEvaluatedAction
@Internal public void setLastEvaluatedAction(@Nullable @Nullable at.petrak.hexcasting.api.casting.castables.Action lastEvaluatedAction)
-