? MatrixColorAPI
MatrixColorAPI 是一个强大且灵活的库,用于在 Minecraft 服务器中处理和应用自定义颜色、渐变以及文本装饰。它支持十六进制颜色、Minecraft 传统颜色代码,以及更高级的格式如渐变和纯色。
该库简化了颜色管理,让开发者能够轻松构建美观排版的文本!

✨ 特性
- ? 支持十六进制颜色和传统颜色代码
- ? 渐变:在文本上应用平滑的颜色过渡。
- ? 纯色:轻松为任意文本应用静态颜色。
- ?️ 文本装饰:支持粗体、斜体、下划线、删除线和随机字符(obfuscated)等文本样式。
- ? 轻量级:对性能影响极小。
- ? 易于使用:提供简洁清晰的 API,方便集成到您的项目中。
- ? 支持所有服务器软件:兼容 Spigot、Paper、Bukkit、Minestom、Fabric 等。
- ?️ 适用于从 1.16.5 开始的所有 Minecraft 版本。
- ?️ 开放贡献:采用 Apache 2.0 许可证授权,允许开源贡献、修改和商业使用!
? 快速开始
虽然 MatrixColorAPI 旨在兼容所有 Minecraft 服务器软件,但目前仅在 Bukkit 平台上进行了广泛测试。我们鼓励其他平台的用户尝试使用并报告遇到的任何问题。您的反馈对于使 MatrixColorAPI 实现全面兼容至关重要!
安装
MatrixColorAPI 托管在 Jitpack 上,使其可以轻松集成到 Maven 或 Gradle 项目中。请按照以下步骤将其添加到您的项目中:
使用 Gradle
-
将 Jitpack 仓库添加到您的 build.gradle 文件中(位于 repositories 块内):
repositories {
maven { url 'https://jitpack.io' }
}
-
添加依赖项到您的 dependencies 块中:
dependencies {
implementation 'com.github.MatrixCreations:MatrixColorAPI:v1.0.7'
}
使用 Maven
-
将 Jitpack 仓库添加到您的 pom.xml 中:
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
-
添加依赖项到您的 dependencies 块中:
<dependency>
<groupId>com.github.MatrixCreations</groupId>
<artifactId>MatrixColorAPI</artifactId>
<version>v1.0.7</version>
</dependency>
附加信息
- 有关最新版本,请向上滚动以查看最新的 API 版本。
- 确保您使用的是 Java 16 或更高版本,以避免兼容性问题。
示例用法
String text = "<SOLID:#FFD700>This is yellow text";
String processed = MatrixColorAPI.process(text);
String gradientText = "<GRADIENT:#FF0000>This is a red to yellow gradient</GRADIENT:#FFFF00>";
String processedGradient = MatrixColorAPI.process(gradientText);
String legacyText = "&aThis is a green text with &lBOLD";
String processedLegacy = MatrixColorAPI.process(legacyText);
String hexText = "&#FFD700This is a yellow text with &lBOLD";
String processedHex = MatrixColorAPI.process(hexText);
?️ 可用方法
process(String text):处理单个字符串的颜色代码、渐变和格式。
process(List<String> texts):处理字符串列表的颜色代码和格式。
? 贡献
我们欢迎贡献!要开始参与:
- Fork 本仓库。
- 为您的功能特性或 Bug 修复创建一个新分支。
- 提交一个包含清晰变更说明的 Pull Request。
请确保遵循编码规范,并在适当的情况下包含测试。
? 许可证
本项目采用 Apache 2.0 License 许可。详见 LICENSE 文件。
? 致谢
感谢所有为本项目做出贡献的人!您的支持和反馈帮助 MatrixColorAPI 变得更好。
? 联系方式
如有任何疑问或反馈,欢迎提交 Issue 或通过我们的 Discord 服务器 联系我们。
? MatrixColorAPI
MatrixColorAPI is a powerful and flexible library for processing and applying custom colors, gradients, and text decorations in Minecraft servers. It supports hex colors, legacy Minecraft color codes, and more advanced formatting like gradients and solid colors.
This library simplifies color management while allowing developers to build beautifully formatted text with ease!

✨ Features
- ? Hex and Legacy Color Code Support
- ? Gradients: Apply smooth color transitions across text.
- ? Solid Colors: Easily apply static colors to any text.
- ?️ Text Decorations: Support for bold, italic, underlined, strikethrough, and obfuscated text styles.
- ? Lightweight: Minimal impact on performance.
- ? Easy to Use: Clean and simple API to integrate into your project.
- ? Supports All Server Software: Compatible with Spigot, Paper, Bukkit, Minestom, Fabric, and more.
- ?️ Works with Every Minecraft Version Starting from 1.16.5.
- ?️ Open to Contributions: Licensed under Apache 2.0 License for open contributions, modifications, and commercial use!
? Getting Started
While MatrixColorAPI is designed to work with all Minecraft server software, it has currently been extensively tested only on Bukkit platforms. We encourage users on other platforms to try it out and report any issues they encounter. Your feedback is crucial in making MatrixColorAPI universally compatible!
Installation
MatrixColorAPI is hosted on Jitpack, making it easy to integrate with your Maven or Gradle projects. Follow the steps below to add it to your project:
Using Gradle
-
Add the Jitpack repository to your build.gradle file (inside repositories block):
repositories {
maven { url 'https://jitpack.io' }
}
-
Add the dependency in your dependencies block:
dependencies {
implementation 'com.github.MatrixCreations:MatrixColorAPI:v1.0.7'
}
Using Maven
-
Add the Jitpack repository to your pom.xml:
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
-
Add the dependency in your dependencies block:
<dependency>
<groupId>com.github.MatrixCreations</groupId>
<artifactId>MatrixColorAPI</artifactId>
<version>v1.0.7</version>
</dependency>
Additional Information
- For the latest version, please scroll up to know the latest api version.
- Ensure you're using Java 16 or higher to avoid compatibility issues.
Example Usages
String text = "<SOLID:#FFD700>This is yellow text";
String processed = MatrixColorAPI.process(text);
String gradientText = "<GRADIENT:#FF0000>This is a red to yellow gradient</GRADIENT:#FFFF00>";
String processedGradient = MatrixColorAPI.process(gradientText);
String legacyText = "&aThis is a green text with &lBOLD";
String processedLegacy = MatrixColorAPI.process(legacyText);
String hexText = "&#FFD700This is a yellow text with &lBOLD";
String processedLegacy = MatrixColorAPI.process(hexText);
?️ Available Methods
process(String text): Process a single string for color codes, gradients, and formatting.
process(List<String> texts): Process a list of strings for color codes and formatting.
? Contributing
We welcome contributions! To get started:
- Fork the repository.
- Create a new branch for your feature or bugfix.
- Submit a pull request with a clear explanation of your changes.
Make sure to follow the coding standards and include tests where appropriate.
? License
This project is licensed under the Apache 2.0 License. See the LICENSE file for details.
? Acknowledgments
Thanks to everyone contributing to this project! Your support and feedback help make MatrixColorAPI even better.
? Contact
For any questions or feedback, feel free to open an issue or reach out to us on our discord server.
评论 0
登录后参与评分
还没有评论,来抢沙发吧