BSLib 首个快照版本发布:现代化 Minecraft 插件开发
我放弃了这个库,它变得太复杂了!!
我们很高兴地宣布 BSLib 的首个快照版本发布。BSLib 是一个强大且全面的框架,旨在彻底改变您在 Minecraft Paper 服务器上开发插件的方式。BSLib 致力于消除样板代码,简化开发工作流程,并将现代响应式编程范式引入 Minecraft 生态系统。
文档
为什么选择 BSLib?
BSLib 基于 状态驱动开发 的原则构建,允许您以声明式方式定义插件的逻辑和 UI。这意味着您可以减少在手动更新上花费的时间,而将更多时间专注于创新功能。主要亮点包括:
- 响应式 UI:创建动态且响应式的 GUI、记分板和其他游戏内元素,当您的数据发生变化时,它们会自动更新,类似于现代 Web 框架。
- 零样板设置:通过
@AutoScan 和 FrameworkPlugin,BSLib 自动处理依赖注入、命令注册、事件监听和配置加载,显著减少了设置时间。
- 强大的异步操作:使用
AsyncChain 安全地管理复杂的异步任务,防止常见的并发问题并确保服务器性能流畅。
- 声明式命令系统:使用简单的注解定义命令和子命令,并附带自动补全和权限处理功能。
- 灵活的状态持久化:轻松将插件数据保存到 YAML 或 JSON,具备自动脏数据跟踪和可配置的自动保存间隔。
- 热重载功能:无需完全重启服务器即可更新插件配置并重新注入服务,极大地加快了您的开发周期。
快速开始
要将 BSLib 集成到您的项目中,您需要在 plugin.yml 文件中声明对 BSLib-paper 插件的依赖,并在构建配置中添加 BSLib 库的依赖项。请将 LATEST_SNAPSHOT_TAG 替换为 BSLib GitHub 仓库中实际的最新提交哈希值或发布标签。
插件依赖 (plugin.yml)
为了使您的插件能够正确使用 BSLib-paper,您 必须 在 plugin.yml 文件中将其声明为依赖项。这确保了 BSLib-paper 会在您的插件之前加载,并且其服务可用。
name: YourPluginName
version: 1.0.0
main: com.yourplugin.YourPluginMainClass
author: YourName
depend: [BSLib]
或者,如果您的插件在没有 BSLib 的情况下仍能运行(尽管功能可能受限),您可以使用 softdepend 代替 depend。
name: YourPluginName
version: 1.0.0
main: com.yourplugin.YourPluginMainClass
author: YourName
softdepend: [BSLib]
库依赖 (构建系统)
Gradle (Groovy DSL)
步骤 1. 在您的 settings.gradle 中添加 JitPack 仓库:
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
mavenCentral()
maven { url 'https://jitpack.io' }
}
}
步骤 2. 在您的 build.gradle 中添加依赖:
dependencies {
implementation 'com.github.Fragmer2.BSLib:bslib-api:7a5257256f'
}
Gradle (Kotlin DSL)
步骤 1. 在您的 settings.gradle.kts 中添加 JitPack 仓库:
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
mavenCentral()
maven { url = uri("https://jitpack.io") }
}
}
步骤 2. 在您的 build.gradle.kts 中添加依赖:
dependencies {
implementation("com.github.Fragmer2.BSLib:bslib-api:7a5257256f")
}
Maven
步骤 1. 在您的 pom.xml 中添加 JitPack 仓库:
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
步骤 2. 在您的 pom.xml 中添加依赖:
<dependency>
<groupId>com.github.Fragmer2.BSLib</groupId>
<artifactId>bslib-api</artifactId>
<version>7a5257256f</version>
</dependency>
SBT
步骤 1. 在您的 build.sbt 中添加 JitPack 解析器:
resolvers += "jitpack" at "https://jitpack.io"
步骤 2. 在您的 build.sbt 中添加依赖:
libraryDependencies += "com.github.Fragmer2.BSLib" % "bslib-api" % "7a5257256f"
Leiningen
步骤 1. 在您的 project.clj 中添加 JitPack 仓库:
:repositories [["jitpack" "https://jitpack.io"]]
步骤 2. 在您的 project.clj 中添加依赖:
:dependencies [[com.github.Fragmer2.BSLib/bslib-api "7a5257256f"]]
反馈与贡献
这是一个早期的快照版本,我们非常鼓励您尝试使用 BSLib 并提供宝贵的反馈。您的意见对于塑造该框架的未来发展至关重要。请在 GitHub 仓库中报告任何问题或建议新功能。
感谢您成为 BSLib 旅程的一部分!
BSLib First Snapshot Release: Modernizing Minecraft Plugin Development
I GAVE UP ON THIS LIBBARY IT'S GETTING TO COMPLICATED!!
We are thrilled to announce the first snapshot release of BSLib, a powerful and comprehensive framework designed to revolutionize the way you develop plugins for Minecraft Paper servers. BSLib aims to eliminate boilerplate code, streamline development workflows, and introduce modern reactive programming paradigms to the Minecraft ecosystem.
DOCUMENTATION
Why BSLib?
BSLib is built on the principle of state-driven development, allowing you to define your plugin's logic and UI in a declarative manner. This means less time wrestling with manual updates and more time focusing on innovative features. Key highlights include:
- Reactive UI: Create dynamic and responsive GUIs, scoreboards, and other in-game elements that automatically update when your data changes, similar to modern web frameworks.
- Zero-Boilerplate Setup: With
@AutoScan and FrameworkPlugin, BSLib handles dependency injection, command registration, event listening, and configuration loading automatically, significantly reducing setup time.
- Robust Asynchronous Operations: Safely manage complex asynchronous tasks with
AsyncChain, preventing common concurrency issues and ensuring smooth server performance.
- Declarative Command System: Define commands and subcommands using simple annotations, complete with automatic tab completion and permission handling.
- Flexible State Persistence: Easily save and load plugin data to YAML or JSON with automatic dirty tracking and configurable autosave intervals.
- Live Reload Capabilities: Update plugin configurations and re-inject services without a full server restart, drastically speeding up your development cycle.
Getting Started
To integrate BSLib into your project, you need to declare a dependency on the BSLib-paper plugin in your plugin.yml file and add the BSLib library dependency to your build configuration. Replace LATEST_SNAPSHOT_TAG with the actual latest commit hash or release tag from the BSLib GitHub repository.
Plugin Dependency (plugin.yml)
For your plugin to correctly utilize BSLib-paper, you must declare it as a dependency in your plugin.yml file. This ensures that BSLib-paper is loaded before your plugin and its services are available.
name: YourPluginName
version: 1.0.0
main: com.yourplugin.YourPluginMainClass
author: YourName
depend: [BSLib]
Alternatively, if your plugin can function with reduced features when BSLib is not present, you can use softdepend instead of depend.
name: YourPluginName
version: 1.0.0
main: com.yourplugin.YourPluginMainClass
author: YourName
softdepend: [BSLib]
Library Dependency (Build System)
Gradle (Groovy DSL)
Step 1. Add the JitPack repository to your settings.gradle:
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
mavenCentral()
maven { url 'https://jitpack.io' }
}
}
Step 2. Add the dependency to your build.gradle:
dependencies {
implementation 'com.github.Fragmer2.BSLib:bslib-api:7a5257256f'
}
Gradle (Kotlin DSL)
Step 1. Add the JitPack repository to your settings.gradle.kts:
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
mavenCentral()
maven { url = uri("https://jitpack.io") }
}
}
Step 2. Add the dependency to your build.gradle.kts:
dependencies {
implementation("com.github.Fragmer2.BSLib:bslib-api:7a5257256f")
}
Maven
Step 1. Add the JitPack repository to your pom.xml:
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
Step 2. Add the dependency to your pom.xml:
<dependency>
<groupId>com.github.Fragmer2.BSLib</groupId>
<artifactId>bslib-api</artifactId>
<version>7a5257256f</version>
</dependency>
SBT
Step 1. Add the JitPack resolver to your build.sbt:
resolvers += "jitpack" at "https://jitpack.io"
Step 2. Add the dependency to your build.sbt:
libraryDependencies += "com.github.Fragmer2.BSLib" % "bslib-api" % "7a5257256f"
Leiningen
Step 1. Add the JitPack repository to your project.clj:
:repositories [["jitpack" "https://jitpack.io"]]
Step 2. Add the dependency to your project.clj:
:dependencies [[com.github.Fragmer2.BSLib/bslib-api "7a5257256f"]]
Feedback and Contributions
This is an early snapshot, and we highly encourage you to experiment with BSLib and provide your valuable feedback. Your input will be crucial in shaping the future development of this framework. Please report any issues or suggest features on the GitHub repository.
Thank you for being a part of the BSLib journey!
评论 0
登录后参与评分
还没有评论,来抢沙发吧