ServerChangelogs
利用直观、基于对话框的 UI,让玩家随时了解服务器的变更!
此插件允许你通过 Minecraft 较新的 对话界面(dialog UIs) 以非常易于访问的形式向玩家展示更新日志。与聊天或书籍中的类似方案相比,这种方法不会被忽略或难以阅读,并且允许玩家只需向下滚动即可回顾之前的变更!
功能
目前,该插件支持以下功能:
- 在玩家加入时向其显示新的更新日志
- 在玩家甚至加入世界之前显示的配置阶段对话框
- 追踪玩家是否已阅读特定的更新日志
- UI 中未读更新日志的指示器
- 使用命令查看所有更新日志
- 通过基于对话框的编辑器,使用对话界面非常用户友好地创建更新日志
- 保存编辑器会话以便稍后使用,这样你可以退出并返回到正在进行的更新日志编辑
- 支持 MiniMessage 用于创建更新日志
- 完全可自定义的更新日志屏幕
- 基于玩家客户端语言的可自定义翻译
支持的服务器软件及版本
ServerChangelogs 目前提供为:
- 一个 Paper 插件(意味着它只能在 Paper 服务器上运行,包括 Purpur 等分支)
- 一个 Velocity 插件(它在代理本身上运行,无论后端服务器是什么)
对于 Paper,插件的初始版本是针对 26.1.2 构建的,这并不总是意味着它不能在较低版本上运行。Paper API 的后向兼容性有时可能效果很好,但情况并非总是如此。
对于 Velocity,这再次不应成为问题,因为那里的客户端版本重要性较低。请注意,此插件大量依赖对话框,而对话框仅在 1.21.6 及以上版本中可用。
如果在较早版本上出现问题,请告诉我并 创建一个 issue (只要你不是试图在 1.8 上运行它),我可能会查看一下!另外,请记住我不会经常更新上面的版本号,而且更新并不总是必要的以支持新版本,所以不妨试一试!
安装
安装此插件应尽可能简单:下载相应版本,并将文件复制到你的 plugins 文件夹中!
之后,重启你的服务器,插件应该自动生成所有配置文件(你可以在 plugins/ServerChangelogs 目录中找到它们!)
命令与权限
该插件提供了一些命令,可以通过以下权限控制对其的访问:
| 插件命令 |
权限 |
描述 |
/scl info |
server_changelogs.command.info |
提供关于插件及平台的信息 |
/scl create |
server_changelogs.command.create |
打开发布新更新日志的 UI |
/scl view |
server_changelogs.command.view |
打开面向玩家的更新日志 UI |
/scl reload |
server_changelogs.command.reload |
重新加载插件配置和所有语言文件 |
/changelog |
server_changelogs.dedicated_command |
执行与 /scl view 相同的功能,但使用专用命令;这对玩家来说可能更直观!注意这不是 NOT /changelogs(末尾没有 S)。 |
| - |
server_changelogs.manage |
允许用户通过更新日志 UI 中的按钮编辑/删除现有更新日志 |
请注意 /server_changelogs、/changelogs 和 /scl 只是同一命令的别名(它们做同样的事情并由相同的权限控制)!
配置与语言
插件配置文件位于 config.yml 中,包含一些用于存储、格式化和 UI 布局的基本选项。
大部分实际的 UI 自定义可以在语言文件(位于 lang 目录中)中完成,这些文件使用 MiniMessage 格式化。如果你不确定要编辑文件的哪一部分,只需在文件中搜索你在游戏中尝试更改的文本即可!
开箱即用,该插件目前仅支持美式英语 (en_US),但可以使用相同的国家代码格式添加更多语言文件(例如 de_DE、fr_FR、en_GB)。
自定义 MiniMessage 标签与子翻译
插件注册了一些自定义的 MiniMessage 标签,你可以在任何翻译中使用它们,包括:
<prefix>: 在 prefix 翻译中定义的插件前缀
<plugin:name>: (内部定义的)插件名称
<plugin:description>: (内部定义的)插件描述
<plugin:version>: 当前运行的插件版本
<plugin:authors>: 以逗号分隔的插件作者列表
<platform:name>: 当前平台的(带颜色/格式化的)名称 (例如 Paper)
<platform:version>: 插件所运行的平台报告出的当前版本
<translate:your.key.here>: 允许你在另一个翻译中包含其他翻译的值。与 MM 的 <lang> 标签不同,这是专门为配合插件的翻译而设计的!请注意,目前此标签不支持参数。
在语言文件中,你还会遇到类似这样的标签:<arg:0>。
这些是参数标签,包含由插件定义的具体文本(如实例变更日志、作者等)。这些参数是特定于某个给定翻译的,这意味着如果在另一个翻译中重复使用它们,要么不起作用,要么会产生潜在的不期望的结果!
如果某个翻译中存在多个参数,可以通过冒号 : 后面的数字来识别它们。
路线图
ServerChangelogs 最初是为我所在的一个小型 Minecraft 服务器制作的,目的是让玩家无需依赖例如 Discord 就能了解更改内容。由于我们希望尽快提供此功能,插件初期不会具备我理想中的所有特性。
下面的路线图包含了我计划在未来添加的一些功能:
- JDBC(关系型)数据库支持:目前,插件将所有变更日志数据(包括谁已经看过哪些变更日志)存储在纯 YAML 文件中。主要原因如上所述(我们需要一个快速的解决方案),因此我们没有优先考虑存储问题。但这随着时间推移开始引发问题,因为每次启动/写入操作需要(反)序列化的数据量大幅增加!适当的实现还必须考虑诸如从现有 YAML 文件自动迁移等事项。
- 预定义作者:与其每次都要输入变更日志的作者姓名(可能还包括格式化),插件配置中可以有一个预定义作者列表供用户选择。
- 可定制的变更日志对话框布局:目前,变更日志对话框始终显示所有之前的变更日志,未读的标记为红色。未来,最好能提供一个选项,例如让玩家加入时只能看到最新的变更日志。
- 分页变更日志:目前,所有现有的变更日志都会直接添加到对话框中,没有任何额外的检查。虽然只有少数几个时没问题,但如果变更日志历史记录很长,这可能会迅速成为一个问题。因此,添加一个带有可配置每页变更日志数量的分页系统将会很棒!
- 玩家首次加入存储:现在,只要玩家尚未阅读过变更日志(除了玩家第一次加入服务器时),变更日志就会在玩家加入时显示。这对于新玩家来说可能会非常困惑,因为他们一开始就不在场参与所有的先前更改!一种可能(虽然并非 100% 完美)的解决方案是记录玩家最初加入服务器/被插件首次看到的时间,然后仅向他们显示相关的变更日志。
- 其他 UI 类型:本节下方的更改计划在不太遥远的未来实施,上述内容目前更相关!无论如何,尽管其他 UI 类型(如聊天、书籍等)可能不那么直观,但一些服务器所有者可能仍然偏好它们。虽然已经有插件可以做到这一点,但如果能与本插件提供的额外功能一起提供这些功能就好了。
- 投票/表决系统?:这是一个有点异想天开的想法,但由于变更日志包含大量,嗯,更改,有时会在玩家之间引起争议。我觉得表决系统可能非常适合这个插件,这样玩家可以在看到特定更改时立即分享他们的意见!
GitHub 上的贡献始终欢迎,所以如果你想帮忙,很高兴看看你是否对实现/协助上述某些想法感兴趣!
ServerChangelogs
Keep players up-to-date on server changes using intuitive, dialog-based UIs!
This plugin allows you to show changelogs to your players in a very accessible form, using minecraft's new-ish dialog UIs! Compared to similar solutions in chat / using books, this approach can't be overseen or be hard to read, and allows players to review earlier changes by just scrolling down!
Features
Currently, the plugin supports the following features:
- Showing new changelogs to players upon joining
- Configuration-phase dialogs that will show before players even join the world
- Tracking whether a player has read a certain changelog
- Indicators for unread changelogs in the UI
- Viewing all changelogs using commands
- Very user-friendly creation of changelogs using dialog UIs through a dialog-based editor
- Saving editor sessions for later, so you can exit and come back to an in-progress changelog
- MiniMessage support for creating changelogs
- A completely customizable changelog screen
- Customizable translations based on the player's client language
Supported Server Software & Versions
ServerChangelogs is currently available as:
- a Paper plugin (meaning it will only run on Paper servers, including forks like Purpur etc.)
- a Velocity plugin (which runs on the proxy itself, no matter what backend servers are used)
For paper, the initial version of the plugin is built against 26.1.2, which doesn't always imply it won't work on lower versions. The backwards-compatibility of the Paper API can sometimes work pretty well, but that's not always the case.
This should again not be a concern for velocity, since the version of the client matters less there. Do note that this plugin relies on dialogs a lot, which are only available starting with 1.21.6.
In case something does break on earlier versions, let me know and create an issue (as long as you're not trying to run it on 1.8), and I might be able to take a look at it! Also, keep in mind that I won't keep the version number above updated very frequently, and that updates aren't always necessary to support a new version, so just give it a try!
Installation
Installing this plugin should be as simple as downloading the appropriate version, and copying the file into your plugins folder!
After that, restart your server and the plugin should generate all the config files automatically (you can find them in the plugins/ServerChangelogs directory!)
Commands & Permissions
The plugin provides a few commands, to which access can be controlled using the following permissions:
| Plugin Command |
Permission |
Description |
/scl info |
server_changelogs.command.info |
Provides version information about the plugin & platform |
/scl create |
server_changelogs.command.create |
Opens the UI to publish a new changelog |
/scl view |
server_changelogs.command.view |
Opens the player-facing changelog UI |
/scl reload |
server_changelogs.command.reload |
Reloads the plugin configuration and all languages |
/changelog |
server_changelogs.dedicated_command |
Does the same as /scl view, but using a dedicated command; this can be more intuitive for players! Note that this is NOT /changelogs (no S at the end). |
| - |
server_changelogs.manage |
Allows the user to edit/delete existing changelogs through buttons in the changelog UI |
Note that /server_changelogs, /changelogs and /scl are just aliases of the
same command (they do the same thing and are controlled by the same permissions)!
Configuration & Language
The plugin configuration can be found in config.yml and includes a few basic options for storage, formatting and UI layout.
Most of the actual UI customization can be done in the language files (found in the lang directory), which are formatted using MiniMessage. If you're not sure what part of the file to edit, just search for the text you're trying to change in-game in the file!
Out of the box, the plugin currently only supports American English (en_US), but more language files can be added using the same country code format (e.g. de_DE, fr_FR, en_GB).
Custom MiniMessage Tags & Sub-Translations
The plugin registers a few custom MiniMessage Tags you can use in any of the translations, including:
<prefix>: The plugin prefix defined in the prefix translation
<plugin:name>: The (internally defined) name of the plugin
<plugin:description>: The (internally defined) plugin description
<plugin:version>: The currently running version of the plugin
<plugin:authors>: A comma-separated list of plugin authors
<platform:name>: The (colored/formatted) name of the current platform (e.g. Paper)
<platform:version>: The current version that the platform the plugin runs on is reporting
<translate:your.key.here>: Allows you to include values of other translations in another translations. Unlike MM's <lang> tag, this is specifically made to work with the plugin's translations! Note that this does not support arguments as of now.
Throughout the language files, you'll also come across tags looking something like this: <arg:0>.
Those are argument tags, which contain specific text defined by the plugin (such as the actual changelog, the author, and more). Those arguments are specific to a given translation, meaning re-using them in another translation either won't work or give potentially unwanted results!
If multiple arguments are present in a certain translation, they can be identified by the number after the :.
Roadmap
ServerChangelogs was originally made for a smaller minecraft server I'm a part of, to make players aware of changes without having to rely on e.g. Discord. Because we wanted this feature to be available pretty fast, the plugin initially won't have as many features as I'd like it to have.
The roadmap below contains some of the features that I'm planning to add in the future:
- JDBC (relational) database support: Currently, the plugin stores all changelog data (including who has already seen what changelogs) in a plain YAML file. The reason for this mostly comes down to the stuff above (we wanted a solution fast), so we didn't prioritize storage. This does start to cause problems over time, since the amount of data that has to be (de-)serialized for each startup/write operation increases by a lot! A proper implementation would also have to consider things like auto-migration from the existing YAML files.
- Pre-defined authors: Rather than having to enter the name of the changelog's author every time (possibly including formatting), there could be a list of pre-defined authors in the plugin config that a user could choose from.
- Customizable changelog dialog layout: Currently, the changelog dialog always shows all previous changelogs, with unread ones marked red. In the future, it'd be nice to have an option for this, e.g. so players on join could also only see the most recent changelog.
- Paged changelogs: At the moment, all existing changelogs are just added to the dialog without any additional checks. While this is fine with just a few of them, it could quickly become an issue with a long history of changelogs. So adding a page system with a configurable amount of changelogs per page would be great!
- Player first-join storage: Right now, changelogs are just displayed to players upon joining whenever they haven't read them (except for the first time a player joins a server). This can be very confusing to new-ish players, since they weren't there for all the previous changes to begin with! A possible (while not 100% perfect) solution to this would be storing when the player initially joined the server / was first seen by the plugin, to then only display relevant changelogs to them.
- Other UI types: The changes in this lower section are planned for a not-so-close future, the stuff above is more relevant for now! Anyway, even though other UI types (like chat, books, etc.) may not be as intuitive, some server owners might still prefer them. While there are plugins out there that can already do this, it would be nice for those to be available along with the additional features this plugin provides.
- A poll/voting system?: A bit of a far-fetched idea, but since changelogs include a lot of, well, change, they can sometimes be controversial along players. I feel like a voting system might fit this plugin kind of well, so players can immediately share their opinion on a specific change right when they see it!
Contributions over on GitHub are always welcome, so if you do want to help out, it'd be nice to see if you are interested in implementing/helping with some of the above ideas!
评论 0
登录后参与评分
还没有评论,来抢沙发吧