WatchPost
适用于 Paper 服务端的安防摄像头与监视器——且玩家永远不会卡在旁观者模式中。
已在 Paper 1.21.11, 26.2 和 26.3 上测试。单个文件,无依赖项,无需 NMS。
为什么会有这个插件
Security Camera Plugin - CCTV 是本领域参考插件——197,532 次下载,4.2 星评分,82 条评价。其最后一次发布是在 2024 年 11 月。我们下载了该版本并在当前的 Paper 版本上自行启动,它在两个版本上均无法启用:
java.lang.NoSuchMethodError:
'com.mojang.authlib.properties.PropertyMap com.mojang.authlib.GameProfile.getProperties()'
at io.github.tanguygab.cctv.utils.Heads.createSkull(Heads.java:53)
at io.github.tanguygab.cctv.CCTV.onEnable(CCTV.java:74)
它并非死于摄像头逻辑本身,而是死于通过 com.mojang.authlib 构建装饰性玩家头颅——这是一个 Mojang 内部类,不属于 Bukkit API 且会随时更改而不作通知。
WatchPost 的构建方式确保了此类故障模式不会发生:
- 不使用
com.mojang.authlib,不依赖 NMS,不对服务器进行反射调用
- 不使用玩家头颅——菜单图标是普通物品,在运行时按名称查找并提供回退机制,因此重命名或移除材质不会导致插件失效
- 不生成实体——CCTV 会为每个摄像头生成一个盔甲架和一个苦力怕。而 WatchPost 的摄像头只是文件中的一行记录。没有任何东西会导致卡顿、内存泄漏或需要清理。
- 从不读取或解析服务端版本字符串
其他任何摄像头插件都无法提供的保证
透过摄像头查看意味着将玩家置于旁观者模式。一旦见过这种昂贵的失败情况,后果便显而易见:当有人正在观看时服务器重启,该玩家重新登录后以旁观者身份进入墙壁内部,完全不知道自己的来源。
WatchPost 会在触碰玩家之前先将返回信息写入磁盘,且仅有一条代码路径用于读取该信息:
| 发生的情况 |
WatchPost 的处理方式 |
玩家潜行或输入 /watchpost leave |
恢复位置、游戏模式、飞行状态和夜视效果 |
| 观看超时 |
同上 |
| 玩家在观看期间断开连接 |
条目保留在磁盘上,下次登录时恢复 |
| 服务器崩溃或被强制终止 |
下次登录时恢复 |
| 插件重载或禁用 |
首先结束所有活跃会话 |
| 摄像头的世界被卸载 |
会话结束,玩家返回原处 |
| 其他人更改了他们的游戏模式 |
WatchPost 放弃控制权而非与之冲突 |
| 返回的世界不再存在 |
玩家传送到主出生点,并在控制台中发出警告 |
飞行权限和飞行状态都包含在该记录中,因此由其他插件授予的 /fly 权限在观看过程中得以保留。坠落距离在返回时会被重置。
功能特性
/watchpost camera create <name> — 在你的眼睛高度放置一个摄像头,朝向你注视的方向
- 摄像头组,以及打开组作为菜单的监视器方块
- 右键点击监视器方块,选择摄像头进行观看;潜行以退出
- 鼠标滚轮切换至组内的下一个摄像头
- 每个监视器可设置访问列表,或设为公共监视器
- 可选的观看时夜视效果(退出时移除——但仅由 WatchPost 添加的效果才会被移除)
- 观看期间禁止使用命令,防止玩家将自身传送至部分恢复的不稳定状态
- 每次观看有时间限制(默认为 5 分钟,设置为
0 则禁用)
- 如果摄像头放置在实心方块内,会立即报告错误,而不是让第一个观看者看到黑屏
从 CCTV 迁移?
/watchpost import
读取 plugins/CCTV/cameras.yml、cameragroups.yml 和 computers.yml,且绝不会向这些文件写入内容。无法迁移的项目会被列出名称,而不会被吞没:缺失的世界、组引用的不存在的摄像头、根本不是摄像头的条目,以及自定义头颅(skin)——WatchPost 没有玩家头颅,这正是它能成功启动的根本原因。
命令
| 命令 |
功能 |
/watchpost camera create|delete|list|enable|disable [name] |
管理摄像头 |
/watchpost group create|delete|add|remove|list [group] [camera] |
管理组 |
/watchpost monitor create <group> / delete |
绑定你正盯着的方块 |
/watchpost view <name>, next, prev, leave |
观看操作 |
/watchpost import |
接管 CCTV 安装配置 |
/watchpost reload |
重新读取配置和数据 |
别名:/cams, /cctv。
权限:watchpost.monitor.use(默认 true)、watchpost.view、watchpost.camera.create、watchpost.camera.delete、watchpost.camera.list、watchpost.group.manage、watchpost.monitor.create、watchpost.admin(管理员)。
WatchPost 不做的事,也绝不假装能做到
- 旁观者模式可以穿墙。 这是 Minecraft 的工作机制,所有服务端摄像头插件都有此特性。因此,决定谁可以放置摄像头是一个信任决策——
watchpost.camera.create 仅限管理员使用是有原因的。本插件不提供录制、运动检测或将摄像头画面渲染到屏幕上的功能;这些需求需要客户端模组或资源包。
- 没有摄像头头颅或装饰模型。见上文:这正是导致前代插件崩溃的原因。
- 一个监视器最多显示 54 个摄像头。
开发说明
本插件的开发得到了 AI 的协助(由人类主导:需求分析、测试和发布决策均由维护者负责)。在每次发布前,它都会在实际运行的 Paper 服务器上经过测试——0.1.0 版本的运行测试针对 Paper 1.21.11、26.2 和 26.3 上发布的类断言了 44 个运行时属性,并与其他 15 个插件共存,结果零错误。
采用 MIT 许可证。
人类主导的开发:人类维护者指导、测试并对每次发布承担责任;AI 仅作为开发工具使用(根据 Modrinth 政策披露)。图标为手工制作的几何艺术作品,非 AI 生成。
WatchPost
Security cameras and monitors for Paper servers — and nobody ever gets stuck in
spectator mode.
Tested on Paper 1.21.11, 26.2 and 26.3. One file, no dependencies, no NMS.
Why this exists
Security Camera Plugin - CCTV is the
reference plugin for this job — 197,532 downloads, 4.2 stars, 82 ratings. Its
last release is from November 2024. We downloaded that release and started it
ourselves on both current Paper versions. It fails to enable on both:
java.lang.NoSuchMethodError:
'com.mojang.authlib.properties.PropertyMap com.mojang.authlib.GameProfile.getProperties()'
at io.github.tanguygab.cctv.utils.Heads.createSkull(Heads.java:53)
at io.github.tanguygab.cctv.CCTV.onEnable(CCTV.java:74)
It did not die in its camera logic. It died building a decorative player head
through com.mojang.authlib — a Mojang-internal class that is not part of the
Bukkit API and changes without notice.
WatchPost is built so that this failure mode cannot happen:
- no
com.mojang.authlib, no NMS, no reflection into the server
- no player heads — menu icons are ordinary items, looked up by name at
runtime with a fallback, so a renamed or removed material cannot stop the plugin
- no entities — CCTV spawns an armor stand and a creeper per camera.
A WatchPost camera is a row in a file. Nothing to lag, leak or clean up.
- the server version string is never read or parsed
The guarantee no other camera plugin gives
Looking through a camera means being put into spectator mode somewhere else. The
expensive failure is obvious once you have seen it: the server restarts while
someone is watching, and that player logs back in as a spectator, inside a wall,
with no idea where they came from.
WatchPost writes the way back to disk before it touches the player, and there
is exactly one code path that reads it back:
| what happens |
what WatchPost does |
player sneaks or types /watchpost leave |
position, game mode, flight and night vision restored |
| the view times out |
same |
| the player disconnects while watching |
entry stays on disk, restored on next login |
| the server crashes or is killed |
restored on next login |
| the plugin is reloaded or disabled |
every open session is ended first |
| the camera's world is unloaded |
session ends, player returns |
| someone else changes their game mode |
WatchPost lets go instead of fighting for control |
| the return world no longer exists |
player goes to the main spawn, with a warning in the console |
Flight permission and flight state are part of that record, so a /fly granted by
another plugin survives the camera. Fall distance is reset on return.
Features
/watchpost camera create <name> — a camera at your eyes, aimed where you look
- Camera groups, and monitor blocks that open a group as a menu
- Right-click a monitor block, click a camera, look around; sneak to leave
- Mouse wheel switches to the next camera in the group
- Per-monitor access lists, or public monitors
- Optional night vision while watching (removed on exit — but only if WatchPost
added it)
- Commands are blocked during the view, so nobody teleports out of a camera
into a half-restored state
- Time limit per view (5 minutes by default,
0 disables it)
- A camera placed inside a solid block is reported immediately, instead of showing
a black picture to the first viewer
Coming from CCTV?
/watchpost import
Reads plugins/CCTV/cameras.yml, cameragroups.yml and computers.yml, and
never writes to them. Whatever cannot be taken over is named, not swallowed:
missing worlds, cameras a group refers to that do not exist, entries that are not
cameras at all, and the custom heads (skin) — WatchPost has no player heads,
which is the whole reason it still starts.
Commands
| command |
what it does |
/watchpost camera create|delete|list|enable|disable [name] |
manage cameras |
/watchpost group create|delete|add|remove|list [group] [camera] |
manage groups |
/watchpost monitor create <group> / delete |
bind the block you are looking at |
/watchpost view <name>, next, prev, leave |
watch |
/watchpost import |
take over a CCTV installation |
/watchpost reload |
re-read config and data |
Aliases: /cams, /cctv.
Permissions: watchpost.monitor.use (default true), watchpost.view,
watchpost.camera.create, watchpost.camera.delete, watchpost.camera.list,
watchpost.group.manage, watchpost.monitor.create, watchpost.admin (op).
What WatchPost does not do, and will not pretend to
- Spectator mode sees through walls. That is how Minecraft works, and every
server-side camera plugin has it. Deciding who may place a camera is therefore
a trust decision —
watchpost.camera.create is op-only for a reason. There is
no recording, no motion detection and no rendering of a camera picture onto a
screen; those need a client mod or a resource pack.
- No camera heads or decorative models. See above: that is exactly what killed
the plugin this one replaces.
- One monitor shows up to 54 cameras.
Development note
This plugin was developed with AI assistance (human-led: requirements, testing and
release decisions by the maintainer). It is tested on live Paper servers before
every release — the run for 0.1.0 asserted 44 runtime properties against the
shipped classes on Paper 1.21.11, 26.2 and 26.3, alongside 15 other plugins, with
zero errors.
MIT licensed.
Human-led development: a human maintainer directs, tests and takes responsibility for every release; AI is used as a development tool (disclosed per Modrinth policy). The icon is hand-made geometric artwork, not AI-generated.
评论 0
登录后参与评分
还没有评论,来抢沙发吧