Comparator 1.0.0
首次公开发布。Comparator 将一系列事件和迷你游戏系统整合到一个插件中,因此你不必运行十几个独立的插件来举办一场比赛。基于 Paper/Folia 1.21 构建,使用 Java 21,并能在 Folia 的区域线程上正常运行(全局调度器调用为零)。
工作原理
你的事件通过一个五阶段的状态机运行:大厅(Lobby)、赛前(Pre-game)、赛中(In-game)、暂停(Paused)和赛后(Post-game)。PvP、统计追踪和实时事件系统会根据当前阶段自动开启或关闭,而开始或结束比赛则会触发奖励机制。
| 状态 |
PvP |
统计 |
事件系统 |
| 大厅 (Lobby) |
否 |
否 |
否 |
| 赛前 (Pre-game) |
否 |
否 |
是 |
| 赛中 (In-game) |
是 |
是 |
是 |
| 暂停 (Paused) |
否 |
否 |
是 |
| 赛后 (Post-game) |
否 |
是 |
否 |
功能概览
事件与队伍 - 创建、开始、暂停、恢复和停止事件。管理带有显示名称和实时成员资格的队伍,以及玩家个人档案。启动时会自动为你设置一个默认事件。
生命之心(吸血) — 实际改变最大生命值的活动和银行心值余额,可配置的击杀偷取量,以及玩家之间的转账。
战斗与目标 — 记录原因的淘汰与复活、安全区和无建筑区,以及类似据点争夺(KOTH)的占领计分。胶囊生成在后台采样地形以将玩家分散在地图上,避免水域,并保持玩家间距。
锦标赛 — 单败淘汰赛和循环赛制,包含种子分配、结果报告和实时排名,全部接入仪表盘和记分板。
统计与奖励 — 异步批量追踪 11 项统计数据(击杀、死亡、造成伤害与受到的伤害、治疗、放置与破坏方块、制作物品、移动距离、占领次数、获得的奖励),并附带排行榜。奖励定义在 rewards.yml 中,可以在状态变更时执行命令、给予物品、修改生命值或显示标题。
界面 — 一个 7 页的 GUI 仪表盘、一个感知状态的侧边栏记分板,以及一个轻量级的 Web 仪表盘(需 Token 验证,基于内置 JDK HTTP 服务器运行,无需额外依赖)。
存储与集成 — 用于统计、审计日志和分析的异步批量 SQLite 数据库,PlaceholderAPI 扩展,以及 bStats 指标。
此外,还提供了一个公共 API,允许其他插件软依赖 Comparator,并且 /comparator reload 可以在不重启服务器的情况下重新加载配置和服务。
世界事件
六个内置事件,你可以从仪表盘或实时触发它们:
| ID |
效果 |
supply-drop |
掉落争夺性战利品供玩家争抢 |
blood-moon |
强制进入夜间并开放战斗窗口 |
border-collapse |
缩小边界以迫使后期战斗发生 |
meteor-storm |
在竞技场降下爆炸性的陨石雨 |
sudden-death |
在 30 秒内将边界缩小至小半径范围 |
resource-rush |
限时资源激增 |
命令
所有内容均通过 /comparator(别名 /cmp)运行,且所有命令都支持对玩家名称、枚举值和实时 ID 进行 Tab 补全。
| 命令 |
功能 |
status |
概览:状态、活跃事件、队伍、区域、锦标赛、持久化数据 |
reload |
重新加载配置和可重载服务 |
dashboard |
打开 GUI |
event <create|start|pause|resume|stop|list> |
管理事件生命周期 |
state <state> |
强制状态转换 |
team <create|join|leave|list> |
管理队伍和分配 |
capsule <plan|dispatch> [radius] |
计划或分发胶囊生成 |
eliminate <player> [reason] |
淘汰一名玩家 |
revive <player> |
复活一名玩家 |
hearts <balance|give|take|set|bank|withdraw|transfer> |
管理心值经济 |
zone <create|list> |
创建或列出区域 (create <id> <type> <radius>) |
worldevent <trigger|list> |
触发或列出世界事件 |
tournament <create|entrant|seed|result|standings|list> |
运行锦标赛 |
stats [statistic] |
显示前十排行榜 |
权限
comparator.admin 覆盖所有权限,comparator.dashboard 仅用于打开 GUI。两者默认均为 op。
配置
设置位于 config.yml 中。以下是一些值得了解的默认值:Web 仪表盘运行在端口 8087,胶囊生成使用 1600 的默认半径,此外还有针对 SQLite 数据库、吸血心值(起始/最小/最大值及每次击杀偷取量)、区域占领计时、记分板以及集成/指标开关的部分。
构建
Paper/Folia 1.21,Java 21。使用 Gradle 9.3 和 Shadow 插件构建,生成 Comparator-0.1.0.jar。SQLite 已阴影处理但未重定位(原生库需要此设置),bStats 已重定位,PlaceholderAPI 为 compileOnly。
Comparator 1.0.0
First public release. Comparator rolls a stack of event and minigame systems into one plugin, so you don't have to run a dozen separate ones to put on a match. Built for Paper/Folia 1.21 on Java 21, and it runs properly on Folia's region threads (no global scheduler calls anywhere).
How it works
Your event runs through a five-stage state machine: lobby, pre-game, in-game, paused, and post-game. PvP, stat tracking, and the live event systems turn on and off automatically depending on the stage, and starting or ending a game fires reward triggers for you.
| State |
PvP |
Stats |
Event systems |
| Lobby |
no |
no |
no |
| Pre-game |
no |
no |
yes |
| In-game |
yes |
yes |
yes |
| Paused |
no |
no |
yes |
| Post-game |
no |
yes |
no |
What's in it
Events and teams - create, start, pause, resume, and stop events. Manage teams with display names and live membership, plus per-player profiles. A default event is set up for you on startup.
Hearts (lifesteal) — active and banked heart balances that actually change max health, a configurable steal-per-kill, and player-to-player transfers.
Combat and objectives — eliminations and revives with logged reasons, safe and no-build zones, and KOTH-style capture scoring. Capsule spawning samples the terrain in the background to spread players across the map, avoid water, and keep everyone spaced out.
Tournaments — single-elimination and round-robin brackets with seeding, result reporting, and live standings, all hooked into the dashboard and scoreboard.
Stats and rewards — async, batched tracking for 11 stats (kills, deaths, damage dealt and taken, healing, blocks placed and broken, items crafted, distance, captures, rewards earned) with leaderboards. Rewards are defined in rewards.yml and can run commands, give items, change health, or show titles on state changes.
Interfaces — a 7-page dashboard GUI, a state-aware sidebar scoreboard, and a lightweight web dashboard that's token-gated and runs on the built-in JDK HTTP server (no extra dependencies).
Storage and integrations — async batched SQLite for stats, audit log, and analytics, a PlaceholderAPI expansion, and bStats metrics.
There's also a public API so other plugins can soft-depend on Comparator, and /comparator reload reloads config and services without a restart.
World events
Six built-in events you can trigger live or from the dashboard:
| ID |
Effect |
supply-drop |
Drops contested loot for players to fight over |
blood-moon |
Forces night and opens a combat window |
border-collapse |
Shrinks the border to force late-game fights |
meteor-storm |
Rains explosive impacts across the arena |
sudden-death |
Shrinks the border to a small radius over 30s |
resource-rush |
Time-boxed resource surge |
Commands
Everything runs under /comparator (alias /cmp), and all of it supports tab-completion for player names, enums, and live IDs.
| Command |
What it does |
status |
Overview: state, active event, teams, zones, tournaments, persistence |
reload |
Reload config and reloadable services |
dashboard |
Open the GUI |
event <create|start|pause|resume|stop|list> |
Manage the event lifecycle |
state <state> |
Force a state transition |
team <create|join|leave|list> |
Manage teams and assignments |
capsule <plan|dispatch> [radius] |
Plan or dispatch capsule spawns |
eliminate <player> [reason] |
Eliminate a player |
revive <player> |
Revive a player |
hearts <balance|give|take|set|bank|withdraw|transfer> |
Manage the heart economy |
zone <create|list> |
Create or list zones (create <id> <type> <radius>) |
worldevent <trigger|list> |
Trigger or list world events |
tournament <create|entrant|seed|result|standings|list> |
Run tournaments |
stats [statistic] |
Show a top-10 leaderboard |
Permissions
comparator.admin covers everything and comparator.dashboard only opens the GUI. Both default to op.
Config
Settings live in config.yml. A few defaults worth knowing: the web dashboard runs on port 8087, capsule spawning uses a 1600 default radius, and there are sections for the SQLite database, lifesteal hearts (starting/min/max and steal-per-kill), zone capture timing, the scoreboard, and integration/metrics toggles.
Build
Paper/Folia 1.21, Java 21. Built with Gradle 9.3 and Shadow, producing Comparator-0.1.0.jar. SQLite is shaded but not relocated (it needs that for native libs), bStats is relocated, and PlaceholderAPI is compileOnly.
评论 0
登录后参与评分
还没有评论,来抢沙发吧