Skip to content

ClientProfile ​

com.jsmacrosce.jsmacros.client.config.ClientProfile

Client-side profile implementation with client event, library, and helper registrations and client-specific error reporting.
Scripts can access the active profile through the client core:

js
const Client = Java.type('com.jsmacrosce.jsmacros.client.JsMacrosClient');  
const profile = Client.clientCore.profile;  
Chat.log(profile.getCurrentProfileName());

Constructors ​

new ClientProfile ​

new ClientProfile(Core<ClientProfile, ?> runner, Logger logger)#
Stores the supplied core and logger through the base profile; registry setup and profile loading are not performed here.

Parameters:

  • runner: client core associated with this profile
  • logger: logger for diagnostics

Fields ​

ignoredErrors ​

static ignoredErrors: Class<? extends Throwable>[]#
Mutable exception classes suppressed from chat error reporting; matching includes subclasses. Stack traces are still printed first. Defaults to InterruptedException and BaseScriptContext.ScriptAssertionError.

Methods ​

checkJoinedThreadStack ​

checkJoinedThreadStack(): boolean#
Checks whether the current thread is Minecraft's thread or is present in this profile's joined-thread set.
Returns: true on the Minecraft thread or when the current thread is in the joined-thread set

initRegistries ​

initRegistries(): void#
Initializes base registries, then registers client events, libraries, and helper mappings. Called during profile initialization; not intended for script invocation.

logError ​

logError(Throwable ex): void#
Prints the failure's stack trace, then attempts to queue a chat report when a GUI is available unless its class or a runtime exception's direct cause matches ignoredErrors. A runtime exception is unwrapped when its message equals its cause's string form. If neither ignore check suppresses it and the runtime exception has a non-null cause but a null message, the comparison can throw NullPointerException. Chat reporting is queued and is not guaranteed to display successfully.

Parameters:

  • ex: non-null failure to report