[开源] legacy-lands-library | 用于 Minecraft 服务器插件开发的企业级模块化框架
本帖最后由 2000000 于 2025-6-15 20:04 编辑## 概述
这是一个基于 (https://github.com/FairyProject/fairy) 构建的综合性库,为现代 Minecraft
插件开发提供了必要的工具和实用程序。它是跨平台的,支持 Spigot Paper 和 Folia。
## 核心模块
- [**annotation**](https://github.com/LegacyLands/legacy-lands-library/tree/main/annotation/README_ZHCN.md) - 强大的注解处理框架,具有灵活的扫描选项和生命周期管理。
- [**commons**](https://github.com/LegacyLands/legacy-lands-library/tree/main/commons/README_ZHCN.md) - 基础工具集,包括 VarHandle 注入、任务调度、虚拟线程调度、JSON 操作和随机对象生成。。
- [**configuration**](https://github.com/LegacyLands/legacy-lands-library/tree/main/configuration/README_ZHCN.md) - 基于 SimplixStorage 构建的灵活配置框架,支持序列化。
- [**mongodb**](https://github.com/LegacyLands/legacy-lands-library/tree/main/mongodb/README_ZHCN.md) - 基于 Morphia 的精简 MongoDB 集成,用于高效数据持久化。
- [**cache**](https://github.com/LegacyLands/legacy-lands-library/tree/main/cache/README_ZHCN.md) - 集成 Caffeine 和 Redis 的多级缓存系统,具有全面的锁机制与通用的线程安全资源管理框架。
- [**player**](https://github.com/LegacyLands/legacy-lands-library/tree/main/player/README_ZHCN.md) - 高性能玩家数据管理,支持多级缓存和实时同步。
- [**script**](https://github.com/LegacyLands/legacy-lands-library/tree/main/script/README_ZHCN.md) - 这是一个强大、灵活、可拓展且高性能的脚本执行引擎封装,支持 `Rhino`, `Nashorn`, `V8`
三种 `JavaScript` 引擎。
- [**experimental**](https://github.com/LegacyLands/legacy-lands-library/tree/main/experimental/README.md) - 一些实验性的模块,可以显著提高性能,但可能过于复杂而无法使用或暂时不稳定。
- [**third-party-schedulers**](https://github.com/LegacyLands/legacy-lands-library/tree/main/experimental/third-party-schedulers/README.md) - 通过 gRPC
外部任务调度器实现分布式任务处理,从而实现大型插件解耦和性能提升(适用于不需要访问 Bukkit API 的后端)。
非常适合机器学习、反作弊大数据计算、数学和类似应用。
- **security** - *即将推出。*
## 使用方法
虽然版本号目前仍是 SNAPSHOT,但这并不代表它不能用于生产环境。事实上,我们计划在一个大型插件开发项目中广泛使用此版本,并在充分验证其稳定性和功能性后,发布第一个正式版本。
### 分发包说明
从 (https://github.com/LegacyLands/legacy-lands-library/actions) 下载:
- `-javadoc`:生成的 API 文档
- `-plugin`:可直接用于服务器的编译插件
- `-sources`:包含源代码和编译类(推荐用于开发)
每个模块的 `README` 中都有详细文档
### Maven 仓库
首先配置 GitHub
认证([了解更多](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens))
```kotlin
repositories {
maven {
url = uri("https://maven.pkg.github.com/LegacyLands/legacy-lands-library")
credentials {
username = project.findProperty("gpr.user") as String? ?: System.getenv("USERNAME")
password = project.findProperty("gpr.key") as String? ?: System.getenv("TOKEN")
}
}
}
dependencies {
compileOnly("net.legacy.library:模块名称:版本号")
}
```
## 社区
- QQ 群: 1022665227
- (https://github.com/LegacyLands/legacy-lands-library/issues)
- [哔哩哔哩](https://space.bilibili.com/1253128469)(中文教程)
我们将在 [哔哩哔哩](https://space.bilibili.com/1253128469)
频道发布更多关于此模块和 (https://github.com/FairyProject/fairy) 的开发教程与经验分享!
## 赞助商
本项目由 (https://github.com/LegacyLands) 全力赞助和维护。
(https://github.com/LuminolMC/Luminol) 是一个基于 Folia 的分支,具有许多有用的优化、可配置的原版特性和更多的 API
支持。
(https://github.com/Deepractice/PromptX) 是 (https://github.com/Deepractice) 开发的 AI 应用原生的专业能力增强系统,在该项目中发挥关键作用。
## Star 历史
[!(https://api.star-history.com/svg?repos=LegacyLands/legacy-lands-library&type=Date)](https://star-history.com/#LegacyLands/legacy-lands-library&Date)
---
页:
[1]