diff --git a/src/main/java/net/ccbluex/liquidbounce/features/module/ModuleManager.kt b/src/main/java/net/ccbluex/liquidbounce/features/module/ModuleManager.kt index 13f94bc554e..e627a163b8c 100644 --- a/src/main/java/net/ccbluex/liquidbounce/features/module/ModuleManager.kt +++ b/src/main/java/net/ccbluex/liquidbounce/features/module/ModuleManager.kt @@ -255,12 +255,18 @@ object ModuleManager : Listenable, Collection by MODULE_REGISTRY { /** * Get module by [moduleClass] */ - operator fun get(moduleClass: Class) = MODULE_REGISTRY.find { it.javaClass === moduleClass } ?: error("Module ${moduleClass.simpleName} is not registered") + operator fun get(moduleClass: Class) = MODULE_REGISTRY.find { it.javaClass === moduleClass } /** * Get module by [moduleName] */ - operator fun get(moduleName: String) = MODULE_REGISTRY.find { it.name.equals(moduleName, ignoreCase = true) } ?: error("No Module found with name [$moduleName]") + operator fun get(moduleName: String) = MODULE_REGISTRY.find { it.name.equals(moduleName, ignoreCase = true) } + + @Deprecated(message = "Only for outdated scripts", replaceWith = ReplaceWith("get(moduleClass)")) + fun getModule(moduleClass: Class) = get(moduleClass) + + @Deprecated(message = "Only for outdated scripts", replaceWith = ReplaceWith("get(moduleName)")) + fun getModule(moduleName: String) = get(moduleName) /** * Handle incoming key presses