Package com.ultikits.ultitools
Class UltiTools
java.lang.Object
org.bukkit.plugin.PluginBase
org.bukkit.plugin.java.JavaPlugin
com.ultikits.ultitools.UltiTools
- All Implemented Interfaces:
Localized,io.papermc.paper.plugin.lifecycle.event.LifecycleEventOwner,net.kyori.adventure.key.Namespaced,org.bukkit.command.CommandExecutor,org.bukkit.command.TabCompleter,org.bukkit.command.TabExecutor,org.bukkit.plugin.Plugin
UltiTools plugin main class.
UltiTools插件主类。
- Version:
- 6.0.7
- Author:
- wisdommen, qianmo
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate CommandExecutionManagerprivate final CommandManagerprivate ConfigManagerprivate DataStoreprivate DependenceManagersprivate ErrorReportCollectorprivate EventBusprivate FileOperationManagerprivate Languageprivate final ListenerManagerprivate LogStreamManagerprivate PlayerEventManagerprivate PluginManagerprivate ServerMonitorManagerprivate ServerPropertiesManagerprivate static UltiToolsprivate URLClassLoaderprivate UpdateManagerprivate static final Patternprivate VersionWrapperDeprecated, for removal: This API element is subject to removal in a future version. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate booleannet.milkbowl.vault.economy.EconomyGet the economy providerstatic org.bukkit.configuration.file.YamlConfigurationgetEnv()Retrieves the YAML configuration object containing environment variables.private InputStreamgetFileResource(String filename) Retrieves the input stream for the specified file resource.static UltiToolsReturns the instance of the UltiTools.static ClassLoaderGet the JavaPlugin class loader.private URL[]Get URLs for module plugin JARs in the UltiTools/plugins directory.static intGets the version of UltiTools.Get server jar file URL.Deprecated, for removal: This API element is subject to removal in a future version.UseXVersionUtilsinstead.Internationalization method that translates the given string based on the current language.private voidprivate booleanprivate voidprivate voidprivate voidprivate voidvoidvoidonEnable()voidonLoad()(package private) static intparsePluginVersion(String versionString) private voidvoidReloads the UltiTools plugins by calling the reload method in the PluginManager.private voidscheduleStartupMessages(boolean loginSuccess) Returns the supported language codes.Methods inherited from class org.bukkit.plugin.java.JavaPlugin
getClassLoader, getCommand, getConfig, getDataFolder, getDefaultBiomeProvider, getDefaultWorldGenerator, getDescription, getFile, getLifecycleManager, getLogger, getPlugin, getPluginLoader, getPluginMeta, getProvidingPlugin, getResource, getServer, getTextResource, init, init, isEnabled, isNaggable, onCommand, onTabComplete, registerCommand, registerCommand, registerCommand, registerCommand, reloadConfig, saveConfig, saveDefaultConfig, saveResource, setEnabled, setNaggable, toStringMethods inherited from class org.bukkit.plugin.PluginBase
equals, getName, hashCode, namespaceMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.bukkit.plugin.Plugin
getComponentLogger, getDataPath, getLog4JLogger, getSLF4JLogger
-
Field Details
-
VERSION_PATTERN
-
ultiTools
-
listenerManager
-
commandManager
-
dependenceManagers
-
ultiToolsClassLoader
-
versionWrapper
Deprecated, for removal: This API element is subject to removal in a future version.UseXVersionUtilsinstead. -
language
-
pluginManager
-
configManager
-
dataStore
-
serverMonitorManager
-
commandExecutionManager
-
fileOperationManager
-
logStreamManager
-
playerEventManager
-
serverPropertiesManager
-
updateManager
-
eventBus
-
errorReportCollector
-
-
Constructor Details
-
UltiTools
public UltiTools()
-
-
Method Details
-
getVersionWrapper
Deprecated, for removal: This API element is subject to removal in a future version.UseXVersionUtilsinstead.手写而不是用 Lombok 的@Getter。Lombok 会把@Deprecated复制到生成的 accessor 上,但丢掉since与forRemoval两个元素,编译产物里只剩一个 裸@Deprecated。而 javac 的-Xlint:removal自 JDK 9 起默认开启、-Xlint:deprecation默认关闭,所以下游用默认参数编译时收不到点名的移除警告, 只会看到一句不含 API 名的笼统提示。字段上标了forRemoval不解决问题 —— 对外的入口是这个 getter,标注必须落在它身上。改回@Getter会让 COMPATIBILITY.md 的移除清单对这一项失真。Hand-written rather than Lombok's
@Getter: Lombok copies@Deprecatedonto the generated accessor but drops thesinceandforRemovalelements, so downstream compiling with default flags never sees the named[removal]warning for this API.- Returns:
- the version wrapper
版本适配器
-
getInstance
Returns the instance of the UltiTools.获取UltiTools的实例。
- Returns:
- the instance of the UltiTools
UltiTools的实例
-
getPluginVersion
public static int getPluginVersion()Gets the version of UltiTools.获取UltiTools的版本。
- Returns:
- the version of the UltiTools
UltiTools的版本
-
parsePluginVersion
-
getEnv
public static org.bukkit.configuration.file.YamlConfiguration getEnv()Retrieves the YAML configuration object containing environment variables.获取包含环境变量的YAML配置对象。
- Returns:
- the YAML configuration object
YAML配置对象
-
onLoad
public void onLoad()- Specified by:
onLoadin interfaceorg.bukkit.plugin.Plugin- Overrides:
onLoadin classorg.bukkit.plugin.java.JavaPlugin
-
onEnable
public void onEnable()- Specified by:
onEnablein interfaceorg.bukkit.plugin.Plugin- Overrides:
onEnablein classorg.bukkit.plugin.java.JavaPlugin
-
initDependencies
private boolean initDependencies() -
initLanguage
private void initLanguage() -
initDataStore
private void initDataStore() -
initPluginModules
private void initPluginModules() -
initWebSocketManagers
private void initWebSocketManagers() -
attemptCloudLogin
private boolean attemptCloudLogin() -
initWebSocket
private void initWebSocket() -
registerCommands
private void registerCommands() -
scheduleStartupMessages
private void scheduleStartupMessages(boolean loginSuccess) -
onDisable
public void onDisable()- Specified by:
onDisablein interfaceorg.bukkit.plugin.Plugin- Overrides:
onDisablein classorg.bukkit.plugin.java.JavaPlugin
-
reloadPlugins
Reloads the UltiTools plugins by calling the reload method in the PluginManager.通过调用PluginManager中的reload方法重新加载UltiTools插件。
- Throws:
IOException- if an I/O error occurs during the reloading process
-
supported
Returns the supported language codes.返回支持的语言代码。
-
i18n
Internationalization method that translates the given string based on the current language. If the string is not found in the dictionary, the original string is returned.根据当前语言翻译给定的字符串的国际化方法。 如果在字典中找不到字符串,则返回原始字符串。
- Parameters:
str- the string to be translated
要翻译的字符串- Returns:
- the translated string or the original string if not found in the dictionary
翻译后的字符串,如果在字典中找不到,则为原始字符串
-
getFileResource
Retrieves the input stream for the specified file resource.获取指定文件资源的输入流。
- Parameters:
filename- the name of the file resource- Returns:
- the input stream for the file resource, or null if an I/O error occurs
-
getEconomy
public net.milkbowl.vault.economy.Economy getEconomy()Get the economy provider获取经济服务提供者
- Returns:
- the instance of the Economy provider
经济服务提供者实例
-
getServerJar
Get server jar file URL.
获取服务器Jar文件URL。- Returns:
- Server jar file URL
服务器Jar文件URL
-
getModuleUrls
Get URLs for module plugin JARs in the UltiTools/plugins directory.
获取 UltiTools/plugins 目录中模块插件JAR的URL。- Returns:
- Array of URLs for module plugin JARs
-
getJavaPluginClassLoader
Get the JavaPlugin class loader. This ensures all class loading operations use the correct parent class loader.
获取JavaPlugin类加载器。 这确保所有类加载操作都使用正确的父类加载器。- Returns:
- JavaPlugin class loader
JavaPlugin类加载器
-
XVersionUtilsinstead.