UserPrefix

轻量级、高效且实时的用户前缀系统。

资源图片
![BANNER](https://raw.githubusercontent.com/CarmJos/UserPrefix/master/.documentation/images/banner.png) README LANGUAGES [ [中文](README.md) | [**English**](README-en.md) ] # UserPrefix 插件 [![CodeFactor](https://www.codefactor.io/repository/github/carmjos/userprefix/badge?s=b76fec1f64726b5f19989aace6adb5f85fdab840)](https://www.codefactor.io/repository/github/carmjos/userprefix) ![CodeSize](https://img.shields.io/github/languages/code-size/CarmJos/UserPrefix) [![License](https://img.shields.io/github/license/CarmJos/UserPrefix)](https://opensource.org/licenses/GPL-3.0) [![Java CI with Maven](https://github.com/CarmJos/UserPrefix/actions/workflows/maven.yml/badge.svg?branch=master)](https://github.com/CarmJos/UserPrefix/actions/workflows/maven.yml) ![Support](https://img.shields.io/badge/Minecraft-Java%201.8--Latest-yellow) ![](https://visitor-badge.glitch.me/badge?page_id=userprefix.readme) 轻量级、高效的实时用户前缀系统。 该插件基于 Spigot 实现,**理论上**支持所有 MineCraft 版本。 该插件的开发基于中文,目的是帮助中国开发者学习 Bukkit 插件 开发。 > 该插件已在 [SpigotMC](https://www.spigotmc.org/resources/userprefix.96277/) 上发布。 > 本插件已在 [MCBBS](https://www.mcbbs.net/forum.php?mod=viewthread&tid=1261503) 上发布,欢迎中文用户来这里下载。 ## 示例 ![example](https://raw.githubusercontent.com/CarmJos/UserPrefix/master/.documentation/images/using-example.png) ## 依赖 - **[必要]** 插件基于 [Spigot-API](https://hub.spigotmc.org/stash/projects/SPIGOT) 和 [BukkitAPI](http://bukkit.org/) 开发。 - **[必要]** 插件数据存储基于 [LuckPerms](https://www.spigotmc.org/resources/luckperms.28140/)。 - **[推荐]** 基于 [PlaceholderAPI](https://www.spigotmc.org/resources/6245/) 的占位符。 关于开发依赖,请查看 [Dependencies](https://github.com/CarmJos/UserPrefix/network/dependencies) 。 ## 特性 - **理论上**支持所有 MineCraft 版本。 - 重新加载配置会立即刷新所有玩家的前缀。 - 权限更改时,实时判断和向玩家反馈。 - 可配置的声音和消息。 - 前缀图标可以配置为“已选择”、“已拥有权限”和“无权限”。 - TabList 自动根据前缀的权重进行排序(如有冲突,可以关闭) - 玩家名称上的前缀显示 (如果发生任何冲突可以关闭) - 简单的聊天格式占位符支持。(不推荐) - 带有自动排序和分页的 GUI! - 支持 PlaceholderAPI 变量! - 支持 [Hex Color](https://www.hexcolortool.com/)! (1.16 及以上版本) `&(#Color)` - 示例: 淡青色 `&(#8470FF)` 、 炭青色 `&(#483D8B)` ## 注意事项 ### 1. 版本支持问题 该插件理论上支持所有版本。 如果图标无法加载,声音无法播放等,请检查配置文件中的物品和声音类型在当前版本中是否存在。 以 SOUND 为例。村民说“OK”的声音在低版本中是"`VILLAGER_YES`",但在高版本中变为"`ENTITY_VILLAGER_YES`"。 ### 2. 积分板异常问题 头上的前缀显示和 TabList 的排序都使用积分板 API。 如果在配置文件中存在冲突,请关闭 `functions.on-name-prefix`。 ## 指令 该插件的指令基于中文! **未来可能支持多语言。** ```text /UserPrefix or /prefix #打开前缀 GUI /UserPrefixAdmin # 查看管理员指令帮助 /UserPrefixAdmin reload # 重新加载配置 /UserPrefixAdmin list # 列出所有配置的前缀。 ``` ## 占位符 (PlaceholderAPI) 安装 [PlaceholderAPI](https://github.com/PlaceholderAPI/PlaceholderAPI) 后, 您可以输入 `/papi info UserPrefix` 以查看所有占位符。 ```text # %UserPrefix_prefix% - 获取当前前缀的内容 # %UserPrefix_weight% - 获取当前前缀的权重。 # %UserPrefix_identifier% - 获取当前前缀的标识符。 # %UserPrefix_name% - 获取当前前缀的名称。 # %UserPrefix_has_% - 确定玩家是否拥有某个前缀(true/false) ``` ## 配置文件 ### 插件配置 ([`config.yml`](src/main/resources/en_US/example-prefix.yml)) 将在首次启动时生成。 ### 消息配置 ([`messages.yml`](src/main/resources/en_US/example-prefix.yml)) 将在首次启动时生成。 ### 前缀配置 ([`prefixes/*.yml`](src/main/resources/en_US/example-prefix.yml)) 所有前缀都是单独的配置文件,存储在 `/prefixes/` 目录下,便于管理。 文件名中的某些符号可能会影响读取,请避免使用它们。 ## 支持和捐赠 该项目由 [YourCraft(你的世界)](https://www.ycraft.cn) 支持。 ![TeamLogo](https://raw.githubusercontent.com/CarmJos/UserPrefix/master/.documentation/images/team-logo.png) ## 开源协议 该项目的源代码使用 [GNU General Public License v3.0](https://opensource.org/licenses/GPL-3.0) 许可。