Class DebugEnvironment

java.lang.Object
gay.object.hexdebug.core.api.debugging.DebugEnvironment
Direct Known Subclasses:
BaseCircleDebugEnv, SimplePlayerBasedDebugEnv

public abstract class DebugEnvironment extends Object
Like CastingEnvironment, but for debugging.
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    DebugEnvironment(@NotNull net.minecraft.server.level.ServerPlayer caster)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    @NotNull net.minecraft.server.level.ServerPlayer
     
    @Nullable DebugStepType
     
    @Nullable at.petrak.hexcasting.api.casting.castables.Action
     
    abstract @NotNull net.minecraft.network.chat.Component
    Returns a display name for this debug session.
    @NotNull UUID
     
    abstract boolean
    For in-world debugees, returns whether the caster is close enough to the debuggee to allow debug-related actions to be performed (eg.
    boolean
     
    void
    printDebugMessage(@NotNull net.minecraft.network.chat.Component message)
     
    void
    printDebugMessage(@NotNull net.minecraft.network.chat.Component message, @NotNull DebugOutputCategory category)
     
    void
    printDebugMessage(@NotNull net.minecraft.network.chat.Component message, @NotNull DebugOutputCategory category, boolean withSource)
     
    void
    printDebugMishap(@NotNull at.petrak.hexcasting.api.casting.eval.CastingEnvironment env, at.petrak.hexcasting.api.casting.eval.sideeffects.OperatorSideEffect.DoMishap sideEffect)
     
    abstract void
    restart(int threadId)
    Attempts to restart the debuggee on the given debug thread.
    abstract boolean
    resume(@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.
    void
    setLastDebugStepType(@Nullable DebugStepType lastDebugStepType)
     
    void
    setLastEvaluatedAction(@Nullable at.petrak.hexcasting.api.casting.castables.Action lastEvaluatedAction)
     
    abstract void
    Terminates the debuggee.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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 use HexDebugCoreAPI.createDebugThread(gay.object.hexdebug.core.api.debugging.DebugEnvironment, java.lang.Integer) and HexDebugCoreAPI.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 that DebugEnvironment is 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()
    • 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

      @NotNull public @NotNull UUID getSessionId()
    • getLastDebugStepType

      @Internal @Nullable public @Nullable DebugStepType getLastDebugStepType()
    • setLastDebugStepType

      @Internal public void setLastDebugStepType(@Nullable @Nullable DebugStepType lastDebugStepType)
    • 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)