LowLevelUtils
Index
Interfaces
Type Aliases
Functions
- addRuntimePack
- debugAPILookUp
- debugBmp
- debugStr
- evalInScope
- forceNativeCrash
- getContext
- getCurrentThreadType
- getInnerCoreVersion
- getMinecraftVersion
- getNetwork
- isDefaultPrevented
- isMainThreadStopped
- runAsUi
- runOnClientThread
- runOnMainThread
- setCustomFatalErrorCallback
- setCustomNonFatalErrorCallback
- setCustomStartupErrorCallback
- setLoadingTip
- setNativeThreadPriority
- simulateBackPressed
- throwException
Interfaces
ICustomErrorCallback
Parameters
message: string
html-formatted message of error, what was happened
error: Throwable
throwable, that was catched by logger
log: string
html-formatted log of error
stacktrace: string
html-formatted stacktrace of error
Returns boolean
Type Aliases
ThreadTypeMarker
Marking for current thread, unknown thread are used by default if this thread is not indented to be server or client-side.
Functions
addRuntimePack
Creates an empty resource or behavior pack with a manifest to add content during mod loading. Please use names without special characters and only with ASCII characters.
Parameters
type: resource | behavior | behaviour
name: string
pack title to be used for folder and displayed in pack list; folder will receive "runtime_<name>" name and title in interface will be "runtime pack: <name>"
Returns string
debugAPILookUp
Dumps AdaptedScript API hieracly to log with debug priority.
Returns void
debugBmp
Displays dialog with given bitmap image and title " bitmap <width>x<height>".
Parameters
bitmap: Bitmap
Returns void
debugStr
Displays dialog with given message and without title.
Parameters
message: string
Returns void
evalInScope
Executes any code in the script body of a given object, the object itself becomes a local list of variables for code execution.
Parameters
code: string
text to evaluate in given scope
scope: object
object in which context code is executed
name: string
script name for errors, debugging, etc.
Returns object
forceNativeCrash
Causes a native error, which immediately leads to the forced closure of the game.
Returns void
getContext
Same as UI.getContext.
Returns android.app.Activity
getCurrentThreadType
It can be used to make sure that an action is performed in intended thread, e.g. sending packet to clients on server.
Returns ThreadTypeMarker
getInnerCoreVersion
Returns string
"2.0.0.0"
getMinecraftVersion
Same as Game.getMinecraftVersion.
Returns string
getNetwork
isDefaultPrevented
Same as Game.isActionPrevented.
Returns boolean
isMainThreadStopped
Gets status of server tick, e.g. is tick disabled due to error. After restarting the world/server, this state is reset.
Returns boolean
runAsUi
Calls an action in the Android interface thread. Any unexpected errors here will lead to the closure of the game, please add
try-catch
blocks to prevent this.Parameters
func: () => void
Returns void
runOnClientThread
Same as runOnClientThread.
Parameters
func: () => void
Returns void
runOnMainThread
Same as runOnMainThread.
Parameters
func: () => void
Returns void
setCustomFatalErrorCallback
Instead of displaying fatal error type in dialog with a log, the specified function will be called to change this behavior.
Parameters
callback: ICustomErrorCallback
Returns void
setCustomNonFatalErrorCallback
Instead of displaying non-fatal error type in dialog with a log, the specified function will be called to change this behavior.
Parameters
callback: ICustomErrorCallback
Returns void
setCustomStartupErrorCallback
Instead of displaying startup error type in dialog with a log, the specified function will be called to change this behavior. For startup errors, only message and recent log are available, all other data will be passed as
null
.Parameters
callback: ICustomErrorCallback
Returns void
setLoadingTip
Changes bottom label on mod loading screen, it is recommended to use it for debugging or visualization of long work during startup.
Parameters
tip: string
Returns void
setNativeThreadPriority
Parameters
priority: number
Returns void
simulateBackPressed
Same as Game.simulateBackPressed.
Returns void
throwException
Parameters
message: string
Returns void
Specific methods, for the most part, are designed to work with Inner Core internals and debug various data.
2.2.1b110