AdminPunish
一个轻量级、自包含的 Paper 1.21.1 服务器惩罚系统。
无需依赖。无需数据库设置。将 jar 放入服务器,重启后,你的管理团队即可立即获得完整的惩罚工具包。
概述
AdminPunish 是一个仅限 OP(管理员)使用的惩罚插件,通过单一统一的命令界面涵盖所有常见的管理操作。所有数据均本地存储在 JSON 文件中,重启后持久保存,并按 UUID 索引,因此玩家记录在改名后依然存在。该插件是直接由经过实战检验的 Skript 脚本移植而来的 Java 版本,在保留原有行为的同时,获得了编译代码的性能和可靠性。
功能
永久封禁 (Permanent Ban)
发出无限期封禁。被封禁的玩家会被立即踢出,断开连接屏幕显示原因、执行的管理员以及申诉提示。在通过 /unban 解除之前,每次尝试登录都会强制执行封禁。
临时封禁 (Temporary Ban)
使用紧凑的时间格式发出限时封禁:30s, 15m, 12h, 7d, 2w。发出封禁时玩家被踢出,并在尝试登录时被阻止,屏幕上显示剩余时间。当封禁到期时,下次玩家尝试连接时会自动解除,无需人工干预。
踢出 (Kick)
断开在线玩家的连接,并显示格式化原因屏幕。此操作会向所有在线玩家广播。
编号警告 (Numbered Warnings)
发出按玩家顺序编号的警告并永久存储。收到警告的玩家会收到可见的聊天通知,随后在三秒后被踢出,并显示带有警告编号、原因和执行管理员的警告屏幕。可以使用 /warnings 完整查看警告记录,并使用 /clearwarnings 清除。
监狱 (Jail)
在不预先配置任何监狱位置的情况下,将玩家冻结在其当前位置。被关押的玩家切换到冒险模式,每秒收到一次持久的动作栏消息,并受到完全限制:
- 头部旋转允许,但块级别移动被阻止
- 所有传送被阻止,包括末影珍珠、 chorus fruit(合唱果实)、/tp 命令和静止室牵引
- 取消末影珍珠投掷
- 破坏和放置方块被阻止
- 所有物品栏交互被阻止
- 丢弃和拾取物品被阻止
- 战斗双向被阻止——被关押的玩家无法被击中,也无法击中他人
- 非 OP 的被关押玩家无法使用命令
如果被关押的玩家断开连接,系统将自动发出 30 分钟的临时封禁并向服务器广播。下次登录时检查封禁:如果已过期,监狱状态也会清除,玩家可以自由加入;如果未过期,他们会在登录界面被阻止,并显示剩余时间。当管理员发出 /unjail 时,玩家恢复为生存模式,并收到释放通知。
命令
| 命令 |
描述 |
/punish <player> ban [reason] |
永久封禁一名玩家 |
/punish <player> tempban <duration> [reason] |
临时封禁一名玩家 |
/punish <player> kick [reason] |
踢出一名在线玩家 |
/punish <player> warn [reason] |
发出编号警告 |
/punish <player> jail [reason] |
在当前位置关押一名玩家 |
/unban <player> |
解除任何活动封禁 |
/unjail <player> |
释放一名被关押的玩家 |
/warnings <player> |
查看玩家的完整警告历史 |
/clearwarnings <player> |
清除玩家的所有警告 |
所有命令都支持在线玩家名称的 Tab 补全。/unban 和 /unjail 还会从存储的 UUID 缓存中建议名称,允许通过名称针对离线玩家。
/punish tempban 的时间格式:在正整数后附加单位字符。支持的单位有 s(秒)、m(分钟)、h(小时)、d(天)和 w(周)。示例:30m, 12h, 7d, 2w。
权限
所有命令都需要 adminpunish.use 权限,默认授予 OP。无需配置文件;在任何标准 Paper 服务器上开箱即用。
数据存储
所有记录均以人类可读的 JSON 文件格式存储在插件的数据文件夹内:
bans.json — 按 UUID 键控的活动和过期封禁记录
warnings.json — 按 UUID 键控的警告历史记录列表
jail.json — 按 UUID 键控的活动监狱记录
players.json — 每次加入时填充的 UUID 到名称和名称到 UUID 的缓存
每次更改后立即将记录写入磁盘。不涉及调度程序或批量写入延迟。
兼容性
- 服务器软件:Paper 1.21.1(API 版本 1.21)
- Java 版本:Java 21
- 依赖项:无 —— Gson 已阴影打包进 jar 中
- 软依赖项:无
安装
- 下载 AdminPunish-2.4.0.jar
- 将其放入服务器的
plugins/ 文件夹
- 重启服务器
无需配置。插件在第一次重启后立即生效。
AdminPunish
A lightweight, self-contained punishment system for Paper 1.21.1 servers.
No dependencies. No database setup. Drop the jar in, restart, and your staff team has a full punishment toolkit available immediately.
Overview
AdminPunish is an OP-only punishment plugin that covers every common moderation action through a single unified command interface. All data is stored locally in JSON files, persists across restarts, and is indexed by UUID so player records survive name changes. The plugin was written as a direct Java port of a battle-tested Skript script, preserving every behaviour precisely while gaining the performance and reliability of compiled code.
Features
Permanent Ban
Issues an indefinite ban. The banned player is immediately kicked with a formatted disconnect screen showing the reason, issuing staff member, and an appeal prompt. The ban is enforced on every subsequent login attempt until lifted with /unban.
Temporary Ban
Issues a time-limited ban using a compact duration format: 30s, 15m, 12h, 7d, 2w. The player is kicked on issuance and blocked on login with a screen showing the time remaining. When the ban expires it is lifted automatically the next time the player attempts to connect, requiring no manual intervention.
Kick
Disconnects an online player with a formatted reason screen. The action is broadcast to all online players.
Numbered Warnings
Issues a warning that is numbered sequentially per player and stored permanently. The warned player receives a visible chat notification, then is kicked three seconds later with a warning screen showing the warning number, reason, and issuing staff. Warnings can be reviewed in full with /warnings and erased with /clearwarnings.
Jail
Freezes a player at their current position without requiring any jail location to be configured in advance. Jailed players are switched to Adventure mode, receive a persistent action bar message every second, and are fully restricted:
Block-level movement is prevented while head rotation is still allowed
All teleportation is blocked, including ender pearls, chorus fruit, /tp, and stasis chamber pulls
Ender pearl throws are cancelled at the source
Block breaking and placing is prevented
All inventory interaction is prevented
Item dropping and picking up is prevented
Combat is blocked in both directions — jailed players cannot be hit and cannot hit others
Command usage is blocked for non-OP jailed players
If a jailed player disconnects, a 30-minute temporary ban is automatically issued and broadcast to the server. On their next login the ban is checked: if it has expired, the jail is also cleared and they join freely; if it has not expired, they are blocked at the login screen with the remaining time. When a staff member issues /unjail, the player is restored to Survival mode and receives a release notification.
Commands
CommandDescription/punish <player> ban [reason]Permanently ban a player/punish <player> tempban <duration> [reason]Temporarily ban a player/punish <player> kick [reason]Kick an online player/punish <player> warn [reason]Issue a numbered warning/punish <player> jail [reason]Jail a player at their current position/unban <player>Lift any active ban/unjail <player>Release a jailed player/warnings <player>View the full warning history for a player/clearwarnings <player>Erase all warnings for a player
All commands support tab-completion for online player names. /unban and /unjail additionally suggest names from the stored UUID cache, allowing offline players to be targeted by name.
Duration format for /punish tempban: append a unit character to a positive integer. Supported units are s (seconds), m (minutes), h (hours), d (days), and w (weeks). Examples: 30m, 12h, 7d, 2w.
Permissions
All commands require the adminpunish.use permission, which defaults to OP. No configuration file is needed; permissions work out of the box on any standard Paper server.
Data Storage
All records are stored as human-readable JSON files inside the plugin's data folder:
bans.json — active and expired ban records keyed by UUID
warnings.json — warning history lists keyed by UUID
jail.json — active jail records keyed by UUID
players.json — UUID-to-name and name-to-UUID cache populated on every join
Records are written to disk immediately on every change. No scheduler or batch-write delay is involved.
Compatibility
Server software: Paper 1.21.1 (API version 1.21)
Java version: Java 21
Dependencies: None — Gson is shaded into the jar
Soft dependencies: None
Installation
Download AdminPunish-2.4.0.jar
Place it in your server's plugins/ folder
Restart the server
No configuration is required. The plugin is operational immediately after the first restart.
评论 0
登录后参与评分
还没有评论,来抢沙发吧