ModuleManager

A fairly simple module manager

Properties

Link copied to clipboard
val EventListener.eventListenerScope: CoroutineScope

Get the related CoroutineScope of receiver EventListener.

Link copied to clipboard
Link copied to clipboard
open val running: Boolean

Returns whether the listenable is running or not, this is based on the parent listenable and if no parent is present, it will return the opposite of isDestructed.

Link copied to clipboard
open override val size: Int

Functions

Link copied to clipboard
fun addModule(module: ClientModule)
Link copied to clipboard
fun Iterable<Vec3>.average(): Vec3
Link copied to clipboard
Link copied to clipboard
fun clear()
Link copied to clipboard
inline fun <E : Event, V> EventListener.computedOn(initialValue: V, priority: Short = 0, crossinline accumulator: (event: E, prev: V) -> V): ReadWriteProperty<EventListener, V>

Returns computed ReadWriteProperty based on the accumulator of specific event.

Link copied to clipboard
open operator override fun contains(element: ClientModule): Boolean
Link copied to clipboard
open override fun containsAll(elements: Collection<ClientModule>): Boolean
Link copied to clipboard
open override fun <T : Event> EventListener.createEventHook(eventClass: Class<T>, wrappedContext: CoroutineContext, priority: Short, handler: SuspendableEventHandler<T>): EventHook<T>
open override fun <T : Event> EventListener.createEventHook(eventClass: Class<T>, wrappedContext: CoroutineContext, priority: Short, handler: SuspendableEventHandler<T>): EventHook<T>
Link copied to clipboard

Creates a ZIP file from multiple files

Link copied to clipboard
inline fun DebuggedOwner.debugGeometry(name: String, lazyGeometry: () -> ModuleDebug.DebuggedGeometry?)
Link copied to clipboard
inline fun DebuggedOwner.debugParameter(name: String, lazyValue: () -> Any?)
Link copied to clipboard
Link copied to clipboard
fun <T : ItemSlot> Iterable<T>.findBestToolToMineBlock(blockState: BlockState, ignoreDurability: Boolean = true, predicate: BiPredicate<ItemStack, BlockState> = BiPredicate { _, _ -> true }): T?

Finds the best slot in this iterable for mining blockState using mc.player as baseline.

Link copied to clipboard
operator fun get(moduleName: String): ClientModule?
Link copied to clipboard
@JvmName(name = "getCategories")
fun getCategories(): Array<String>

This is being used by UltralightJS for the implementation of the ClickGUI. DO NOT REMOVE!

Link copied to clipboard
@JvmName(name = "getModuleByName")
fun getModuleByName(module: String): ClientModule?
Link copied to clipboard
@JvmName(name = "getModules")
fun getModules(): Collection<ClientModule>
Link copied to clipboard
inline fun <T : Event> EventListener.handler(priority: Short = 0, handler: Consumer<T>): EventHook<T>
fun <T : Event> EventListener.handler(eventClass: Class<T>, priority: Short = 0, handler: Consumer<T>): EventHook<T>
Link copied to clipboard
open override fun isEmpty(): Boolean
Link copied to clipboard
open operator override fun iterator(): Iterator<ClientModule>
Link copied to clipboard
fun Collection<Component>.joinToText(separator: Component): Component

Joins a list of Component into a single Component with the given separator.

fun <T> Collection<T>.joinToText(separator: Component, prefix: Component? = null, postfix: Component? = null, transform: Function<T, Component>): Component
Link copied to clipboard
Link copied to clipboard
inline fun <T> Collection<T>.mapString(transform: (T) -> Char): String

Transform a Collection to a String with by given transform

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
inline fun <E : Event> EventListener.newEventHook(priority: Short = 0, handler: Consumer<E>): EventHook<E>
Link copied to clipboard
inline fun <T : Event> EventListener.once(priority: Short = 0, crossinline handler: (T) -> Unit): EventHook<T>
Link copied to clipboard
Link copied to clipboard

Register inbuilt client modules

Link copied to clipboard

Remove cached scope and cancel it.

Link copied to clipboard
Link copied to clipboard
inline fun <T : Event> EventListener.repeated(times: Int = 1, priority: Short = 1, crossinline handler: (T) -> Unit): EventHook<T>
Link copied to clipboard
inline fun <T : Event> EventListener.sequenceHandler(priority: Short = 0, dispatcher: CoroutineDispatcher? = null, onCancellation: Runnable? = null, crossinline eventHandler: SuspendableEventHandler<T>): EventHook<T>

Registers an event hook for events of type T and launches a sequence

Link copied to clipboard
inline fun <T : Event> EventListener.suspendHandler(context: CoroutineContext = EmptyCoroutineContext, priority: Short = 0, behavior: SuspendHandlerBehavior = SuspendHandlerBehavior.Parallel.Default, noinline handler: SuspendableEventHandler<T>): EventHook<T>

Start a Job on event.

Link copied to clipboard
inline fun EventListener.tickHandler(dispatcher: CoroutineDispatcher? = null, onCancellation: Runnable? = null, crossinline eventHandler: suspend CoroutineScope.() -> Unit): EventHook<GameTickEvent>

Registers a repeatable sequence which repeats the execution of code on GameTickEvent.

Link copied to clipboard
Link copied to clipboard
open fun unregister()

Unregisters the event handler from the manager. This decision is FINAL! After the class was unregistered we cannot restore the handlers.

Link copied to clipboard
inline fun <T : Event> EventListener.until(priority: Short = 0, crossinline handler: (T) -> Boolean): EventHook<T>
Link copied to clipboard
inline suspend fun <T : Event> EventListener.waitMatches(priority: Short = 0, predicate: Predicate<T>): T

Wait an event of type T which matches given predicate.

suspend fun <T : Event> EventListener.waitMatches(eventClass: Class<T>, priority: Short, predicate: Predicate<T>): T
Link copied to clipboard
inline suspend fun <T : Event> EventListener.waitMatchesWithTimeout(timeout: Duration, priority: Short = 0, predicate: Predicate<T>): T?

Wait an event of type T which matches given predicate. If the timeout is exceeded, return null.

Link copied to clipboard

Wrap the original interceptor and make it auto-detect the listener's running state at suspension to determine whether to resume the continuation.