WhitelistDb 模组
描述
本模组用于在不同服务器之间保持相同的白名单,并支持使用不同方法来允许用户加入白名单。 例如,在一个学校 Minecraft 服务器中,玩家必须验证其学校邮箱才能从 Discord 机器人处获得白名单命令的权限。(请注意,本模组不提供 Discord 机器人。)
命令
- /whitelistdb toggle
- 开启或关闭白名单
- /wban <player> [reason]
- 更新数据库记录,显示该玩家在所有服务器上均被封禁!
- 如果玩家在线,将会将其踢出服务器——即使玩家不在线也能生效
- 理由(reason)为可选参数,仅在
ban_reasons_enabled为true时才会保存(见下文) - 包含空格的名称可以用引号括起来:
/wban "Some Name" griefing
- /wunban <player>
- 更新数据库记录,显示该玩家在所有服务器上均已解封!
- 同时清除已保存的封禁理由(当启用封禁理由时)
入门指南
要正确使用此模组,数据表中至少需要包含以下信息。
uuid : UUID
banned : Boolean(列名可以不同——请在配置中设置 ban_column)
tag : String(可选——用于占位符 API,列名可以不是 tag)
ban_reason : String(可选——仅在 ban_reasons_enabled 为 true 时需要,列名由 ban_reason_column 设置)
本模组还会在本地缓存用户名和 UUID,以便更轻松地封禁/解封离线玩家。
如果将此模组添加到已运行的服务器,可以使用提供的 Python 脚本 scripts/convert.py,正确读取服务器根目录下的 usercache.json 文件,并生成一个应放置在 config/whitelistdb 中的文件。这一步并非完全必要,因为缓存会在新玩家加入时自动更新,但这样做可以确保模组能够检测到所有曾经加入过的玩家。
将模组放入模组文件夹后启动服务器,它将在 config/whitelistdb-config.json 位置创建一个配置文件。你可以在这里编辑默认值以正确设置数据库,并修改未列入白名单以及玩家被禁止访问时显示的提示信息。
config/whitelistdb-config.json 的默认布局
{
"host": "localhost",
"port": 5432,
"database": "minecraft",
"username": "postgres",
"password": "password",
"table": "server_whitelists",
"placeholder_column": "tag",
"ban_column": "banned",
"ban_reasons_enabled": false,
"ban_reason_column": "ban_reason",
"ssl": false,
"message": "You are not whitelisted!",
"enabled": true,
"banReason": "You have been banned!",
"banMessageWithReason": "You have been banned!\nReason: %reason%"
}
如果您是从旧版本升级,新的设置将在服务器下次启动时自动添加到您现有的配置文件中。
封禁原因
ban_column- 标记玩家为被封禁的真/假列的名称。ban_reasons_enabled- 设置为true以在每次封禁时保存原因,并在踢出玩家时显示该原因。默认关闭。ban_reason_column- 保存原因的文本列。在启用原因之前,请将其添加到您的表中,例如:ALTER TABLE server_whitelists ADD COLUMN ban_reason text;banMessageWithReason- 当封禁包含原因时使用的踢出消息。%reason%将被替换为原因,\n表示换行。 没有原因(或原因功能已关闭)的封禁将使用banReason代替。
此模组的占位符为 %whitelistdb:playerinfo%。
- 在 1.21.x 中,旧的
%whitelistdb:school%占位符仍然有效。
请注意,目前 NeoForge 不支持 占位符!
构建
每个平台分为两个模块:
fabric/neoforge/paper- 26.x,Java 25fabric-1.21/neoforge-1.21/paper-1.21- 1.21 - 1.21.11,Java 21
每个模块都使用相同的 -PminecraftVersion 属性,并且仅响应其支持的版本
(1.x 版本进入 -1.21 模块,26.x 版本进入其他模块)。
# 单个版本
./gradlew :fabric:build -PminecraftVersion=26.3
./gradlew :neoforge:build -PminecraftVersion=26.3
./gradlew :paper:build -PminecraftVersion=26.3
./gradlew :fabric-1.21:build -PminecraftVersion=1.21.5
./gradlew :neoforge-1.21:build -PminecraftVersion=1.21.5
./gradlew :paper-1.21:build -PminecraftVersion=1.21.5
所有版本
./gradlew :fabric:buildAllVersions
./gradlew :neoforge:buildAllVersions
./gradlew :paper:buildAllVersions
./gradlew :fabric-1.21:buildAllVersions
./gradlew :neoforge-1.21:buildAllVersions
./gradlew :paper-1.21:buildAllVersions
Jars 文件位于每个模块的 build/libs 文件夹中。
模组信息
当前版本:1.8.0
目前支持:
- Fabric:1.21 - 1.21.11,26.1 - 26.3
- NeoForge:1.21 - 1.21.11,26.1 - 26.3
- Paper:1.21 - 1.21.11,26.1.1 - 26.3(Paper 从未发布过 1.21.2 或 26.1)
WhitelistDb Mod
Description
This mod is used to make it easier to have the same whitelist across different servers and to use different methods for allowing users to whitelist. For example, having people in a school Minecraft server, and in order for them to join, they have to verify their school email to gain access to a whitelist command from a Discord bot. (Please note that this does not provide a Discord bot.)
Commands
- /whitelistdb toggle
- Turns the whitelist on and off
- /wban <player> [reason]
- Updates the database record to show they are banned across all servers!
- Will kick the player if they are online - does work on players who aren't online
- The reason is optional and is only saved when
ban_reasons_enabledistrue(see below) - Names with spaces can be put in quotes:
/wban "Some Name" griefing
- /wunban <player>
- Updates the database record to show they are unbanned across all servers!
- Also clears the saved ban reason when ban reasons are enabled
Getting Started
To use this mod correctly, the table needs to at least have this information in it.
uuid : UUID
banned : Boolean (can be called something else - set ban_column in the config)
tag : String (Optional - for placeholder api, can be called something other than tag)
ban_reason : String (Optional - only needed if ban_reasons_enabled is true, name set with ban_reason_column)
This mod also caches usernames and UUIDs locally to ban/unban offline players much more easily.
If this is being added to a server that is already up, you can use the Python script provided in scripts/convert.py to correctly take the usercache.json file in the root directory of the server and make a file that should be placed in config/whitelistdb. This isn't completely necessary, as the cache will auto-update when new people join, but this will make sure that everyone who has ever joined will be detected by the mod.
When the mod is in the mod folder, start the server, and it will make a file located at config/whitelistdb-config.json. This is where you can edit the default values to correctly set up the database and edit the messages that come up when not whitelisted and when users are banned.
Default layout of config/whitelistdb-config.json
{
"host": "localhost",
"port": 5432,
"database": "minecraft",
"username": "postgres",
"password": "password",
"table": "server_whitelists",
"placeholder_column": "tag",
"ban_column": "banned",
"ban_reasons_enabled": false,
"ban_reason_column": "ban_reason",
"ssl": false,
"message": "You are not whitelisted!",
"enabled": true,
"banReason": "You have been banned!",
"banMessageWithReason": "You have been banned!\nReason: %reason%"
}
If you're updating from an older version, the new settings are added to your existing config file automatically the next time the server starts.
Ban reasons
ban_column- the name of the true/false column that marks a player as banned.ban_reasons_enabled- set totrueto save a reason with each ban and show it when the player is kicked. Off by default.ban_reason_column- the text column the reason is saved in. Add it to your table before turning reasons on, e.g.ALTER TABLE server_whitelists ADD COLUMN ban_reason text;banMessageWithReason- the kick message used when a ban has a reason.%reason%is replaced with the reason and\nstarts a new line. Bans without a reason (or with reasons turned off) usebanReasoninstead.
The placeholder for this mod is %whitelistdb:playerinfo%.
- On 1.21.x the old
%whitelistdb:school%placeholder also still works.
Please note that currently neoforge does not support placeholders!
Building
Each platform is split into two modules:
fabric/neoforge/paper- 26.x, Java 25fabric-1.21/neoforge-1.21/paper-1.21- 1.21 - 1.21.11, Java 21
Every module uses the same -PminecraftVersion property and only reacts to versions it supports
(1.x versions go to the -1.21 modules, 26.x versions to the others).
# One version
./gradlew :fabric:build -PminecraftVersion=26.3
./gradlew :neoforge:build -PminecraftVersion=26.3
./gradlew :paper:build -PminecraftVersion=26.3
./gradlew :fabric-1.21:build -PminecraftVersion=1.21.5
./gradlew :neoforge-1.21:build -PminecraftVersion=1.21.5
./gradlew :paper-1.21:build -PminecraftVersion=1.21.5
# Every version
./gradlew :fabric:buildAllVersions
./gradlew :neoforge:buildAllVersions
./gradlew :paper:buildAllVersions
./gradlew :fabric-1.21:buildAllVersions
./gradlew :neoforge-1.21:buildAllVersions
./gradlew :paper-1.21:buildAllVersions
Jars end up in each module's build/libs folder.
Mod Information
Current version: 1.8.0
Currently Supported:
- Fabric: 1.21 - 1.21.11, 26.1 - 26.3
- NeoForge: 1.21 - 1.21.11, 26.1 - 26.3
- Paper: 1.21 - 1.21.11, 26.1.1 - 26.3 (Paper never released 1.21.2 or 26.1)
下载 WhitelistDb Mod
下载 WhitelistDb Mod
下载 WhitelistDb Mod
下载 WhitelistDb Mod
下载 WhitelistDb Mod
下载 WhitelistDb Mod
下载 WhitelistDb Mod
下载 WhitelistDb Mod
下载 WhitelistDb Mod
下载 WhitelistDb Mod
- 新增将封禁原因作为可选项进行保存的功能
- 现已支持从 1.21 及以上的所有 Minecraft 版本
完整更新日志:
关于这个资源的讨论、问题反馈与使用心得
还没有讨论,来发第一帖吧
你是这个资源的作者?登录后可认领此资源。
相似资源
模组
一个用于收集生物掉落物的多区块模组。
模组
显示你正在注视的方块的信息。(适用于 Minecraft 1.16+ 的 Hwyla/Waila 分支)
模组
使用 JavaScript 编辑配方、添加自定义物品、编写世界事件!
模组
查看物品与配方
模组
在游戏画面角落显示附近世界地形、玩家、生物和实体的地图。可创建路径点,帮助你找到标记过的位置。
模组
AE2:一款流行的自动化与存储模组
评论 0
登录后参与评分
还没有评论,来抢沙发吧