ForestCore

插件

· 作者 camper_crafting

我插件的 API

0 本站下载 0 关注 更新于 1 年前

最新 1.0-SNAPSHOT · 1.16.5 · Paper

一键开服(送7天)

ForestCore

一个为我的插件一次性添加多种功能的插件。

主要功能

1. 更新系统

  • 通过 Modrinth 自动检查更新
  • 在控制台中通知可用的更新
  • 支持所有连接到 ForestCore 的插件

2. 颜色系统

  • 支持 HEX 颜色 (&#000000)
  • 支持原版颜色 (&f)
  • 提供便捷的 ColorUtils.colorize() 方法供插件使用

3. 插件管理菜单

  • 查看所有已连接的插件
  • 显示每个插件的信息:
    • 名称
    • 版本
    • 插件 ID
    • 运行状态
  • 能够直接从菜单编辑插件配置

4. 命令系统

  • /fcore - 关于 ForestCore 的基本信息
  • /fcore help - 列出所有命令
  • /fcore help <plugin-id> - 特定插件的命令
  • /fcore reload <plugin-id> - 重新加载插件配置
  • /fcore menu - 打开插件管理菜单
  • /fcore <plugin-id> - 查看特定插件的信息

安装

对于服务器管理员

  1. 在项目构建后,从 target 文件夹下载最新的 ForestCore-1.0-SNAPSHOT.jar
  2. 将文件放入服务器的 plugins 文件夹中
  3. 重启服务器
  4. ForestCore 准备就绪!

对于开发者

将插件连接到 ForestCore

1. 添加依赖

在你的插件的 pom.xml 中添加:

<repositories>
    <repository>
        <id>github</id>
        <name>GitHub Packages</name>
        <url>https://maven.pkg.github.com/camper_crafting/ForestCore</url>
    </repository>
</repositories>

<dependencies>
    <dependency>
        <groupId>ru.forestcore</groupId>
        <artifactId>ForestCore</artifactId>
        <version>1.0-SNAPSHOT</version>
        <scope>provided</scope>
    </dependency>
</dependencies>

2. 在 plugin.yml 中添加依赖

depend: [ForestCore]

3. 注册插件

在你的插件的 onEnable() 方法中:

ForestCore forestCore = (ForestCore) Bukkit.getPluginManager().getPlugin("ForestCore");
if (forestCore != null) {
    ForestPlugin forestPlugin = new ForestPlugin(
        "Plugin Name",           // 插件名称
        getDescription().getVersion(), // 插件版本
        "plugin-id",                  // 唯一插件 ID
        "camper_crafting",            // 作者名称
        "https://modrinth.com/plugin/your-plugin", // 指向 Modrinth 的链接
        "https://github.com/your-username/your-plugin", // 指向 GitHub 的链接
        Arrays.asList(                // 插件命令列表
            "/command1 - Command Description 1",
            "/command2 - Command Description 2"
        )
    );
    forestCore.getPluginManager().registerPlugin("plugin-id", forestPlugin);
}

颜色用法

HEX 颜色

String message = ColorUtils.colorize("&#FF0000Red text");

原版颜色

String message = ColorUtils.colorize("&cRed text");

颜色组合

String message = ColorUtils.colorize("&#FF0000Red text &aand green text");

插件示例

仓库中包含一个名为 ExamplePlugin 的 example-plugin.yml,演示了以下内容:

  • 连接到 ForestCore
  • 使用颜色
  • 注册命令
  • 与 ForestCore 菜单集成

要求

  • Minecraft 1.16.5
  • Paper/Spigot 服务器
  • Java 8 或更高版本

支持

如果您遇到任何问题或有疑问,请在 GitHub 仓库中创建一个 Issue。

你是这个资源的作者?登录后可认领此资源。

评论 0

0.0
暂无评分
5 星
0
4 星
0
3 星
0
2 星
0
1 星
0
我的评分

登录后参与评分

还没有评论,来抢沙发吧

评论配图

相似资源