Class PositionUtil
java.lang.Object
com.blamejared.crafttweaker.api.zencode.util.PositionUtil
-
Method Summary
Modifier and TypeMethodDescriptionstatic CodePositionReads the current script position based on the current Thread's stacktrace Works by grabbing the first zs file from the stacktrace.static CodePositiongetZCScriptPositionFromStackTrace(StackTraceElement[] stackTrace) Reads the current script position based on the provided stacktrace elements Works by grabbing the first zs file from the stacktrace.
-
Method Details
-
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
VirtualSourceFileso 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
VirtualSourceFileso you cannot access the script content!- Returns:
- The position, or
CodePosition.UNKNOWN
-