概述
这是一个用于对带有特定配置文件的模组进行模块化管理的模组。
Reborn: Vape Manager Reborn
你可以按 V 键打开该模组的配置界面以管理模组。默认情况下,配置界面中没有任何物品。不过,你可以通过将此模组根目录下的 example.json 文件解压到游戏目录中的 config/vm/mods 目录来测试此模组。
以下是 example.json 文件的内容。如果你是开发者并希望将此模组作为前置模组使用,可以参考此文件内容来编写你的模组:
{
"name": "Vape Manager",
"id": "vm",
"main": "cn.ksmcbrigade.VM.Manager",
"function": "getKey",
"function_2": "runKey",
"gui_main": "cn.ksmcbrigade.VM.Manager",
"gui_function": "getScreen"
}
上述各项的功能如下:
- name: 必填,支持国际化(i18n);
- id: 可选,无实际用途;
- main: 必填,用于获取模组功能函数所在类的地址;
- function: 可选,若不使用则填写 "NONE",用于获取在 “main” 所写的类文件中定义的按键值函数;
- function_2: 必填,用于运行在 “main” 所写的类文件中定义的模组功能函数;
- gui_main: 可选,若不使用则填写 "NONE",用于获取模组 GUI 功能所在类的地址;
- gui_function: 可选,若不使用则填写 "NONE",用于获取在 “gui_main” 所写的类文件中定义的按键值函数。
以下是用于运行模组功能函数的示例:
public static void runKey(Player player){ //不是 LocalPlayer
player.sendMessage(Component.nullToEmpty("Vape manager v1.0"),player.getUUID());
}
其他函数参数为空。
提示
此模组还提供了一些可供调用的 API 函数。这些函数位于 cn.ksmcbrigade.VM.Utils 类中。
该项目已在 GitHub 上开源。
Overview
This is a mod that allows for modular management of mods with specific configuration files.
Reborn: Vape Manager Reborn
You can press the V key to open the mod's configuration interface to manage mods. By default, the configuration interface has no items. However, you can test this mod by extracting the example.json file from the root directory of this mod to the config/vm/mods directory in the game directory.
Below is the content of the example.json file. If you are a developer and want to use this mod as a prerequisite mod, you can refer to this file content to write your mod:
{
"name": "Vape Manager",
"id": "vm",
"main": "cn.ksmcbrigade.VM.Manager",
"function": "getKey",
"function_2": "runKey",
"gui_main": "cn.ksmcbrigade.VM.Manager",
"gui_function": "getScreen"
}
Here are the functions of the above items:
- name: Required, supports i18n;
- id: Optional, useless;
- main: Required, used to get the class file address of the mod's functional functions;
- function: Optional, fill in "NONE" if not used, used to get the key-value function in the class file written in "main";
- function_2: Required, used to run the mod's functional functions in the class file written in “main”;
- gui_main: Optional, fill in "NONE" if not used, used to get the class file address of the mod's GUI functions;
- gui_function: Optional, fill in "NONE" if not used, used to get the key-value function in the class file written in “gui_main”.
Here is an example of the function used to run the mod's functional functions:
public static void runKey(Player player){ //No is LocalPlayer
player.sendMessage(Component.nullToEmpty("Vape manager v1.0"),player.getUUID());
}
Other function parameters are empty.
Tips
This mod also provides a small number of API functions that can be called. The functions are located in the cn.ksmcbrigade.VM.Utils class.
It has been open-sourced on GitHub.
评论 0
登录后参与评分
还没有评论,来抢沙发吧