Class PositionUtil

java.lang.Object
com.blamejared.crafttweaker.api.zencode.util.PositionUtil

public final class PositionUtil extends Object
  • Method Details

    • getZCScriptPositionFromStackTrace

      public static CodePosition getZCScriptPositionFromStackTrace()
      Reads the current script position based on the current Thread's stacktrace Works by grabbing the first zs file from the stacktrace.

      The Position's file will always be a VirtualSourceFile so you cannot access the script content!

      Returns:
      The position, or CodePosition.UNKNOWN
    • getZCScriptPositionFromStackTrace

      @Nonnull public static CodePosition getZCScriptPositionFromStackTrace(StackTraceElement[] stackTrace)
      Reads the current script position based on the provided stacktrace elements Works by grabbing the first zs file from the stacktrace.

      The Position's file will always be a VirtualSourceFile so you cannot access the script content!

      Returns:
      The position, or CodePosition.UNKNOWN