✨ Takion
Takion 是一个用于在 Spigot 和 Paper Minecraft API 之上构建高级聊天和文本体验的一站式工具包。从丰富的消息格式化到按频道划分的审核规则,Takion 提供了一套精选的管理器、适配器和实用程序,让你可以专注于游戏玩法而非基础设施。
TL;DR:将 Takion 插入你的插件中,即可获得感知调度器的消息层、强大的占位符解析、灵活的频道路由以及开箱即用的丰富格式化功能。?♂️
? 目录
- 亮点
- 模块概览
- 生态系统与捆绑 API
- 安装
- 快速入门
- 功能游览
- 从源代码构建
- 贡献指南
- 许可证
? 亮点
- 生产就绪的聊天核心:具备颜色管道、丰富组件和一致的对齐逻辑。
- 频道、占位符和规则管理:直接内置于
TakionLib 入口点,在你的插件生命周期中可实现单行访问。
- 调度器集成:通过
GlobalScheduler,无需样板代码即可轻松运行异步或延迟的消息传递任务。
- 即插即用的指标统计(bstats)以及在使用插件发行版时的可选 Vault/聊天桥接。
- 支持重打包(Shading):可选择轻量级核心 API、重打包二进制文件、带有额外捆绑库的
shaded:all 变体,或演示插件模块。
? 模块概览
Takion 是一个多模块 Gradle 项目。选择适合你分发策略的工件:
| 模块 |
描述 |
适用场景 |
common |
me.croabeast.common 下的共享实用程序,包括构建器、反射辅助、时间工具、依赖加载和 GUI 辅助。 |
独立于主 Takion API 复用实用程序 API。 |
core |
包含 TakionLib 和管理器的主要 Takion API。如果你只需要针对暴露的 API 进行编译或验证核心源码,则它是可选的。 |
针对 Takion 的主 API 进行编译或自行重打包。 |
shaded |
将 common 和 core 与所需的库(PrismaticAPI、GlobalScheduler、YAML-API)重新打包在一起,并发布带有额外捆绑库的 all 分类器。 |
在不配置消费者仓库的情况下发布单个 jar 文件。 |
plugin |
示例/生产就绪的插件包,引入可选适配器(Vault、bStats)并使用 Shadow 重定位包。 |
直接在服务器上部署 Takion 或作为进一步自定义的基础插件。 |
所有模块均使用 Gradle 工具链针对 Java 8 目标构建,因此你可以在现代 JDK 上构建和运行,同时保持与旧版 Minecraft 主机的兼容性。
? 生态系统与捆绑 API
Takion 依赖于同一作者创建的多个经过实战检验的库:
可选集成如 InteractiveChat 或 Vault 可以在插件模块内切换,而不会影响核心 API。
? 安装
添加公共仓库并选择适合你工作流的依赖项。截至 Takion 1.6.3,工件位于
me.croabeast.takion 组下,并按模块(common、core、shaded、plugin)发布,shaded 还附带额外的 all 分类器。
注意:运行时你只需要 shaded、shaded:all 或 plugin 工件之一。common 和 core 工件是可选的——当你希望 IDE 访问源码或计划自行重打包 Takion 时,将它们保留为
compileOnly 依赖项,但它们在生产服务器上不是必需的。
Gradle (Kotlin DSL)
repositories {
maven("https://croabeast.github.io/repo/")
}
dependencies {
// 可选:将 common/core 保留在 compileOnly 类路径上以获取源码访问权限,同时进行重打包
compileOnly("me.croabeast.takion:common:1.6.3")
compileOnly("me.croabeast.takion:core:1.6.3")
// 恰好选择一个运行时依赖
implementation("me.croabeast.takion:shaded:1.6.3")
// implementation("me.croabeast.takion:shaded:1.6.3:all")
// implementation("me.croabeast.takion:plugin:1.6.3")
}
Gradle (Groovy DSL)
repositories {
maven { url "https://croabeast.github.io/repo/" }
}
dependencies {
// 可选:在编译时保留 common/core 的 compileOnly classpath 以便访问源码,同时执行阴影打包(shading)
compileOnly "me.croabeast.takion:common:1.6.3"
compileOnly "me.croabeast.takion:core:1.6.3"
// 选择其中一个作为运行时依赖
implementation "me.croabeast.takion:shaded:1.6.3"
// implementation "me.croabeast.takion:shaded:1.6.3:all"
// implementation "me.croabeast.takion:plugin:1.6.3"
}
Maven
<repositories>
<repository>
<id>croabeast-repo</id>
<url>https://croabeast.github.io/repo/</url>
</repository>
</repositories>
<dependencies>
<!-- 可选:包含 common/core 以便在编译时访问 API -->
<dependency>
<groupId>me.croabeast.takion</groupId>
<artifactId>common</artifactId>
<version>1.6.3</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>me.croabeast.takion</groupId>
<artifactId>core</artifactId>
<version>1.6.3</version>
<scope>provided</scope>
</dependency>
<!-- 选择其中一个作为运行时依赖 -->
<dependency>
<groupId>me.croabeast.takion</groupId>
<artifactId>shaded</artifactId>
<version>1.6.3</version>
</dependency>
<!--
<dependency>
<groupId>me.croabeast.takion</groupId>
<artifactId>shaded</artifactId>
<version>1.6.3</version>
<classifier>all</classifier>
</dependency>
<dependency>
<groupId>me.croabeast.takion</groupId>
<artifactId>plugin</artifactId>
<version>1.6.3</version>
</dependency>
-->
</dependencies>
声明完毕后,重新加载你的项目,即可导入 TakionLib。
? 快速入门
-
在插件的 onEnable 钩子中初始化库:
public class MyPlugin extends JavaPlugin {
private TakionLib takion;
@Override
public void onEnable() {
takion = new TakionLib(this);
}
}
-
发送带有占位符和渐变的丰富消息:
takion.getLoadedSender()
.addPlaceholder("{player}", player.getName())
.send("<gradient:#8a4dff:#4dfcff>Hello, {player}!<reset>");
-
显示带有动画时序的标题:
takion.getTitleManager()
.builder("&dWelcome", "&7Enjoy your stay!")
.fadeIn(10).stay(60).fadeOut(10)
.send(player);
-
在处理交互式聊天组件时复用 Takion 的棱镜聊天处理器:
BaseComponent[] components = MultiComponent
.fromString(takion.getChatProcessor(), "<run:\"/spawn\">Spawn</text>")
.compile(player);
Takion 会自动创建此处理器。插件仅在需要替换默认的组件预处理时才需要调用 setChatProcessor(...)。
所有内容均通过 TakionLib 暴露,因此只要保持对该实例的引用,其余管理器只需一个方法调用即可使用。
? 功能概览
| 功能模块 |
说明 |
| PlaceholderManager |
注册、解析并链式处理占位符,支持基于上下文的值,并在存在时集成 Vault/聊天相关功能。 |
| MessageSender |
构建可复用的模板,应用渐变效果,居中文本,并向玩家、控制台或特定受众发送消息。 |
| TitleManager |
全局配置淡入淡出时序,并通过流畅的构建器 API 构建一次性标题。 |
| CharacterManager |
标准化字符宽度,处理小型大写字母,确保聊天或 GUI 中的文本完美对齐。 |
| ChannelManager |
定义命名聊天频道,路由消息,并附加格式要求或权限限制。 |
| FormatManager & Rules |
解析简单标记语言,强制执行服务器特定的规则(通过 GameRuleManager),并将其融合到出站消息中。 |
| TakionLogger |
结构化日志记录,支持可选的服务端/插件端分离,彩色输出以及外部 API 钩子。 |
| GlobalScheduler |
统一的异步/同步任务调度,兼容 Bukkit、Paper 和 Folia 环境。 |
所有组件均设计为模块化:你可以单独使用它们,也可以将它们组合起来构建完整的聊天管道。
?️ 从源码构建
- 克隆仓库:
git clone https://github.com/CroaBeast/Takion.git
cd Takion
- 构建所有模块(jar 文件将生成在
*/build/libs 目录中):
./gradlew clean build
- 选择你的制品:
common/build/libs/common-<version>.jar - 共享工具类。
core/build/libs/core-<version>.jar – 仅包含 API。
shaded/build/libs/shaded-<version>.jar – 阴影打包发行版。
shaded/build/libs/shaded-<version>-all.jar – 带有 all 分类器的阴影打包发行版。
plugin/build/libs/plugin-<version>.jar – 已重定位包路径的可直接运行的插件。
Gradle Wrapper 会自动处理依赖下载,因此无需其他额外设置。
? 贡献指南
我们欢迎各方贡献!在提交 Pull Request 之前:
- 请在 GitHub Issues 或 Discord 服务器中讨论重大功能。
- 遵循现有的代码风格,如果项目中已经使用了 Lombok 注解,请优先使用它们。
- 在添加新的消息功能或集成时,请包含测试或示例。
- 运行
./gradlew check 以确保构建通过且无错误。
? 许可证
Takion 根据 GNU 通用公共许可证 v3.0 发布。请参阅 LICENSE 文件以获取完整条款。在服务器上使用阴影/插件分发版本即表示您接受 GPLv3 的要求。
祝您打造愉快的聊天体验!?
✨ Takion
Takion is an all-in-one toolkit for building premium chat and text experiences on top of the Spigot and Paper Minecraft APIs. From rich message formatting to per-channel moderation rules, Takion ships with a curated set of managers, adapters, and utilities so you can focus on gameplay instead of infrastructure.
TL;DR: Drop Takion into your plugin to gain a scheduler-aware messaging layer, powerful placeholder resolution, flexible channel routing, and plenty of formatting sugar out-of-the-box. ?♂️
? Table of Contents
- Highlights
- Module Overview
- Ecosystem & Bundled APIs
- Installation
- Quickstart
- Feature Tour
- Building from Source
- Contributing
- License
? Highlights
- Production-ready chat core featuring color pipelines, rich components, and consistent alignment logic.
- Channel, placeholder, and rule management baked directly into the
TakionLib entry point for one-line access in your plugin lifecycle.
- Scheduler integration via
GlobalScheduler, making it trivial to run asynchronous or delayed messaging tasks without boilerplate.
- Drop-in metrics (bstats) and optional Vault/chat bridges when using the plugin distribution.
- Ready for shading—choose between the lightweight core API, the shaded binary, the
shaded:all variant with extra bundled libraries, or the demonstration plugin module.
? Module Overview
Takion is a multi-module Gradle project. Pick the artifact that matches your distribution strategy:
| Module |
Description |
Ideal For |
common |
Shared utilities under me.croabeast.common, including builders, reflection helpers, time utilities, dependency loading, and GUI helpers. |
Reusing utility APIs independently from the main Takion API. |
core |
The primary Takion API containing TakionLib and managers. Optional when you only need to compile against the exposed API or validate the core sources. |
Compiling against Takion's main API or shading it yourself. |
shaded |
Repackages common and core together with required libraries (PrismaticAPI, GlobalScheduler, YAML-API) and also publishes an all classifier with extra bundled libraries. |
Shipping a single jar without configuring repositories in your consumer. |
plugin |
Example/production-ready plugin bundle that brings in optional adapters (Vault, bStats) and relocates packages using Shadow. |
Deploying Takion directly on a server or as a base plugin for further customization. |
All modules target Java 8 using Gradle toolchains, so you can build and run on modern JDKs while remaining compatible with legacy Minecraft hosts.
? Ecosystem & Bundled APIs
Takion leans on several battle-tested libraries created by the same author:
- PrismaticAPI - color gradients, RGB conversion and interactive chat components.
- YAML-API – lightweight YAML configuration helpers and file management.
- GlobalScheduler – abstraction for Paper/Spigot task scheduling.
- VaultAdapter (plugin module) – bridges Vault chat/permissions into Takion placeholders.
- CommandFramework and AdvancementInfo** (via the
shaded:all classifier) – extendable command and advancement utilities.
- bStats (plugin module) – anonymous usage metrics (relocated to avoid conflicts).
Optional integrations such as InteractiveChat or Vault can be toggled inside the plugin module without affecting the core API.
? Installation
Add the public repository and choose the dependency that fits your workflow. As of Takion 1.6.3, artifacts live under the
me.croabeast.takion group and are published per-module (common, core, shaded, plugin), with an additional all classifier on shaded.
Heads up: You only need either the shaded, shaded:all, or plugin artifact at runtime. The common and core artifacts are optional—keep them as
compileOnly dependencies when you want IDE access to the sources or plan to shade Takion yourself, but they are not
required on your production server.
Gradle (Kotlin DSL)
repositories {
maven("https://croabeast.github.io/repo/")
}
dependencies {
// Optional: keep common/core on the compileOnly classpath for source access while shading
compileOnly("me.croabeast.takion:common:1.6.3")
compileOnly("me.croabeast.takion:core:1.6.3")
// Choose exactly one runtime
implementation("me.croabeast.takion:shaded:1.6.3")
// implementation("me.croabeast.takion:shaded:1.6.3:all")
// implementation("me.croabeast.takion:plugin:1.6.3")
}
Gradle (Groovy DSL)
repositories {
maven { url "https://croabeast.github.io/repo/" }
}
dependencies {
// Optional: keep common/core on the compileOnly classpath for source access while shading
compileOnly "me.croabeast.takion:common:1.6.3"
compileOnly "me.croabeast.takion:core:1.6.3"
// Choose exactly one runtime
implementation "me.croabeast.takion:shaded:1.6.3"
// implementation "me.croabeast.takion:shaded:1.6.3:all"
// implementation "me.croabeast.takion:plugin:1.6.3"
}
Maven
<repositories>
<repository>
<id>croabeast-repo</id>
<url>https://croabeast.github.io/repo/</url>
</repository>
</repositories>
<dependencies>
<!-- Optional: include common/core for compilation-time access to the API -->
<dependency>
<groupId>me.croabeast.takion</groupId>
<artifactId>common</artifactId>
<version>1.6.3</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>me.croabeast.takion</groupId>
<artifactId>core</artifactId>
<version>1.6.3</version>
<scope>provided</scope>
</dependency>
<!-- Choose exactly one runtime -->
<dependency>
<groupId>me.croabeast.takion</groupId>
<artifactId>shaded</artifactId>
<version>1.6.3</version>
</dependency>
<!--
<dependency>
<groupId>me.croabeast.takion</groupId>
<artifactId>shaded</artifactId>
<version>1.6.3</version>
<classifier>all</classifier>
</dependency>
<dependency>
<groupId>me.croabeast.takion</groupId>
<artifactId>plugin</artifactId>
<version>1.6.3</version>
</dependency>
-->
</dependencies>
Once declared, reload your project and you are ready to import TakionLib.
? Quickstart
-
Initialize the library during your plugin's onEnable hook:
public class MyPlugin extends JavaPlugin {
private TakionLib takion;
@Override
public void onEnable() {
takion = new TakionLib(this);
}
}
-
Send rich messages with placeholders and gradients:
takion.getLoadedSender()
.addPlaceholder("{player}", player.getName())
.send("<gradient:#8a4dff:#4dfcff>Hello, {player}!<reset>");
-
Display titles with animation timings:
takion.getTitleManager()
.builder("&dWelcome", "&7Enjoy your stay!")
.fadeIn(10).stay(60).fadeOut(10)
.send(player);
-
Reuse Takion's Prismatic chat processor when working with interactive chat components:
BaseComponent[] components = MultiComponent
.fromString(takion.getChatProcessor(), "<run:\"/spawn\">Spawn</text>")
.compile(player);
Takion creates this processor automatically. Plugins only need setChatProcessor(...) when they want to replace the default component preprocessing.
Everything is exposed through TakionLib, so once you keep a reference, the rest of the managers are a method call away.
? Feature Tour
| Capability |
What it does |
| PlaceholderManager |
Register, resolve, and chain placeholders with context-aware values, including Vault/chat integrations when present. |
| MessageSender |
Compose reusable templates, apply gradients, center text, and deliver to players, console, or audiences. |
| TitleManager |
Configure fade timings globally and build one-off titles through a fluent builder API. |
| CharacterManager |
Normalize character widths, handle small capitals, and align text perfectly in chat or GUIs. |
| ChannelManager |
Define named chat channels, route messages, and attach formatting or permission requirements. |
| FormatManager & Rules |
Parse simple markup, enforce server-specific rules (GameRuleManager), and blend them into outbound messages. |
| TakionLogger |
Structured logging with optional server/plugin separation, colorized output, and external API hooks. |
| GlobalScheduler |
Unified async/sync task scheduling compatible with Bukkit, Paper, and Folia environments. |
All components are designed to be modular: you can use them individually or stitch them together for a full chat pipeline.
?️ Building from Source
- Clone the repository:
git clone https://github.com/CroaBeast/Takion.git
cd Takion
- Build every module (jars end up in
*/build/libs):
./gradlew clean build
- Pick your artifact:
common/build/libs/common-<version>.jar - shared utilities.
core/build/libs/core-<version>.jar – API only.
shaded/build/libs/shaded-<version>.jar – shaded distribution.
shaded/build/libs/shaded-<version>-all.jar – shaded distribution with the all classifier.
plugin/build/libs/plugin-<version>.jar – ready-to-run plugin with relocated packages.
Gradle Wrapper handles dependency downloads, so no additional setup is required.
? Contributing
We welcome contributions! Before opening a pull request:
- Discuss major features in GitHub issues or in the Discord server.
- Follow the existing code style and prefer Lombok annotations where the project already uses them.
- Include tests or examples when adding new messaging features or integrations.
- Run
./gradlew check to ensure the build stays green.
? License
Takion is distributed under the GNU General Public License v3.0. See the LICENSE file for full terms. Using the shaded/plugin distributions on a server implies acceptance of the GPLv3 requirements.
Enjoy crafting delightful chat experiences! ?
评论 0
登录后参与评分
还没有评论,来抢沙发吧