描述
TheBridge 是一款 Minecraft Java 版服务器的小游戏插件。两个队伍(1v1 或 2v2)在虚空之上的桥梁上对战。向敌方建造方块、进行战斗,并通过进入敌方目标区得分。率先达到分数限制的队伍获胜。如有问题,请提交 issue。
更新日志 [1.1.0]
- 支持 1.13 至 1.21(现支持 1.13 至 26.x)
- 添加了教程视频
- 更改了 Java 版本
- 更改了配置
功能
- 1v1 和 2v2(任何队伍规模最高可达
match.max-team-size)
- 多个竞技场,每个保存在独立文件中
- 竞技场状态:
DISABLED(禁用)、WAITING(等待中)、STARTING(开始中)、IN_GAME(游戏中)、ENDING(结束中)、RESETTING(重置中)
- 带有清晰错误提示的设置验证(缺失内容时无法启用竞技场)
- 无需指令即可检测目标,防止重复目标保护
- 重生延迟、虚空死亡、虚空击杀计分
- 可配置装备、可建造方块、破坏规则
- 竞技场重置:仅跟踪并分批恢复发生变化的方块
- 玩家崩溃恢复(物品栏、位置、游戏模式……)及竞技场方块恢复
- SQLite 统计信息(胜场、败场、进球、击杀、死亡、比赛场次、连胜),在后台线程保存
- 标题栏、动作栏、音效、可选的控制台指令奖励
- 兼容 Spigot、CraftBukkit、Paper 及 Paper 分支
- 权限与 Tab 补全
安装
- 下载插件 jar 文件。
- 将其放入 plugins 文件夹
- 重启服务器
- 创建竞技场(参见 竞技场设置示例)
兼容性
| 服务器软件 |
预期可用? |
备注 |
| Paper, Purpur, Pufferfish, Leaves (1.13 - 1.21) |
是 |
它们包含 Spigot API。 |
| Spigot, CraftBukkit (1.13 - 1.21) |
是 |
CraftBukkit 拥有相同的 Bukkit API。Spigot 专用部分使用了 BungeeCord 聊天 API(用于动作栏)以及 player.spigot().respawn()。纯 CraftBukkit 构建若无 Spigot 扩展则缺少这两项。 |
| Folia |
否 |
TheBridge 使用标准的 Bukkit 调度器,且未声明 folia-supported。 |
- “预期”意味着代码仅调用了该服务器上存在的 API。仅部分这些服务器经过测试。请反馈您的实际使用情况。
指令
主指令:/thebridge(别名:/tb, /bridge)
| 指令 |
描述 |
权限 |
/thebridge help |
显示指令列表 |
无 |
/thebridge list |
列出竞技场及其状态和玩家 |
thebridge.join |
/thebridge join [arena] |
加入竞技场(若未指定名称则随机加入空闲的) |
thebridge.join |
/thebridge leave |
离开当前比赛 |
thebridge.leave |
/thebridge stats [player] |
显示统计信息 |
thebridge.stats |
/thebridge create <arena> |
在当前世界创建一个竞技场 |
thebridge.admin |
/thebridge setup <arena> |
打开设置菜单(按钮将执行以下指令) |
thebridge.admin |
/thebridge setlobby <arena> |
将等待室设置为你的位置 |
thebridge.admin |
/thebridge setspawn <arena> <red|blue> |
将队伍出生点设置为你的位置 |
thebridge.admin |
/thebridge pos1 / pos2 |
选择两个角点(供 setgoal 和 setbounds 使用) |
thebridge.admin |
/thebridge setgoal <arena> <red|blue> |
设置该队伍防守的目标 = 所选框体 |
thebridge.admin |
/thebridge setbounds <arena> |
设置竞技场范围框 = 所选框体(其底部为虚空) |
thebridge.admin |
/thebridge teamsize <arena> <n> |
1 = 1v1, 2 = 2v2 ... |
thebridge.admin |
/thebridge scorelimit <arena> <n> |
此竞技场获胜所需的进球数(0 = 使用 config.yml 中的设置) |
thebridge.admin |
/thebridge duration <arena> <seconds> |
此竞技场的比赛时长(秒)(0 = 使用 config.yml 中的设置) |
thebridge.admin |
/thebridge enable <arena> |
验证并启用竞技场 |
thebridge.admin |
/thebridge disable <arena> |
关闭竞技场(安全取消正在进行的比赛) |
thebridge.admin |
/thebridge stop <arena> |
取消正在进行的比赛(不计胜负,不记录统计) |
thebridge.admin |
/thebridge info <arena> |
显示竞技场设置及存在的问题 |
thebridge.admin |
/thebridge delete <arena> |
删除一个已禁用的竞技场 |
thebridge.admin |
/thebridge reload |
重新加载 config.yml(不重载竞技场文件) |
thebridge.admin |
权限
| 权限 |
默认值 |
用途 |
thebridge.admin |
OP |
所有设置/管理命令。在比赛期间也允许使用任何命令。 |
thebridge.join |
true |
加入竞技场并列出它们。 |
thebridge.leave |
true |
离开比赛。 |
thebridge.stats |
true |
查看统计数据。 |
thebridge.bypass |
OP |
在空且等待中的竞技场内建造/破坏方块(用于编辑地图)。出于安全考虑,它绝不会对正在比赛中的玩家或在有比赛的竞技场内生效。 |
竞技场设置示例
首先构建你的地图(两个岛屿,中间是虚空,每侧有一个目标点)。然后,站在地图所在的世界中:
/thebridge create lava
/thebridge setlobby lava (站在等待室中)
/thebridge setspawn lava red (站在红色出生点)
/thebridge setspawn lava blue
/thebridge pos1 (站在红色目标区的一个角上)
/thebridge pos2 (站在对角线上)
/thebridge setgoal lava red (红方在此处防守,蓝方在此处得分)
/thebridge pos1 (蓝色目标区的角落)
/thebridge pos2
/thebridge setgoal lava blue
/thebridge pos1 (围绕整个竞技场的框,从虚空层一直延伸到最高建筑高度之上)
/thebridge pos2
/thebridge setbounds lava
/thebridge teamsize lava 1 (1v1;使用 2 表示 2v2)
/thebridge enable lava
如果有遗漏项,enable 会明确告诉你。玩家随后使用 /thebridge join lava。当竞技场满员时,比赛开始。
基本准则: 边界底部即为虚空:低于它将导致死亡。出生点必须在边界内,且不能位于目标区内。大厅可以位于任何位置。
单人测试(单人测试模式)
没有朋友或第二个账号?在 config.yml 中设置以下内容并运行 /thebridge reload:
match:
solo-test: true
然后独自加入一个竞技场:倒计时将在一名玩家在场时开始。你将成为红队,并通过进入 蓝色 目标区得分。你可以测试倒计时、目标区、虚空死亡、建造规则、桥梁重置以及比赛结束。你 无法 测试战斗、击杀和投降(这需要对手)。
单人测试模式下的比赛永远不会写入统计数据,也不会给予奖励。该设置在玩家加入空竞技场时读取,因此在没有比赛等待时开启或关闭此设置。在实际服务器上请将其关闭。
要在自己的 PC 上测试双人游戏,你还可以在本地服务器(online-mode=false)上使用离线账号运行第二个客户端。
比赛流程
- 玩家加入;当竞技场满员时,开始倒计时(
match.countdown)。
- 分配队伍,传送并装备玩家,每轮开始时会有短暂的冻结时间(
match.round-countdown)。
- 进入 敌方 目标区得一分。玩家和(可选地)桥梁将被重置。
- 比赛在达到
match.score-limit 个目标分结束时,或在 match.duration 时间耗尽时结束(目标分多者获胜,目标分相同则为平局)。
- 显示结果,玩家恢复其旧物品栏和位置,竞技场重置并重新开放。
在比赛中途离开或断线被视为退出:你将立即收回自己的物品,如果一方无人留守,另一方获胜。不支持重新加入 比赛。崩溃后重新加入 服务器 将恢复你的物品和位置。
配置
所有内容都在 plugins/TheBridge/config.yml 中(文件内有文档说明):倒计时、持续时间、分数上限、重生延迟、队伍人数上限、允许放置的方块、破坏规则、装备({team} 将变为 RED/BLUE)、重置行为、统计数据、奖励、效果以及所有消息。无效的数字会在控制台发出警告并进行修正。每个竞技场的特定值位于 plugins/TheBridge/arenas/<name>.yml 中。
当新插件版本需要更新的 config-version 时,你的旧文件会被重命名为 config-<version>.yml,并写入一个新的配置文件(与我其他插件的处理方式相同)。
竞技场重置限制
重置会恢复玩家放置或破坏的每个方块的 类型和方块状态(旋转、浸水等……),每刻处理数百个方块。它 不会 恢复以下内容:
- 容器内的物品(玩家在比赛中无法打开容器),
- 除掉落物和箭之外的实体(这些将被移除),
- 沙子/砾石下落、红石、TNT 连锁反应、由其他插件或命令引起的更改。请勿将重力方块或红石放入
build.allowed-blocks 中,
- 流体:水桶被禁用,且竞技场内的液体流动会被取消。
崩溃安全性:更改的方块列表每隔 reset.journal-interval 秒保存到 plugins/TheBridge/journals/ 目录中。崩溃后,竞技场将在下次启动时从此文件中恢复。崩溃前几秒内更改的方块可能会丢失。
统计数据
SQLite 文件 plugins/TheBridge/stats.db。所有数据库操作都在一个后台线程上运行,因此服务器永远不会因磁盘 I/O 而等待。如果出现数据库问题,将在日志中记录,但绝不会阻止比赛。存储代码位于 Storage 接口之后,以便将来可以添加 MySQL/MariaDB 支持;目前仅支持 SQLite。
PlaceholderAPI
可选。如果已安装 PlaceholderAPI,TheBridge 会自动注册自身(无需执行 /papi ecloud download)。可在记分板、标签页列表、全息图和聊天插件中使用这些占位符。
玩家所在比赛的占位符(当玩家不在比赛中时为空,因此记分板可以隐藏相关行):
| 占位符 |
值 |
%thebridge_in_game% |
true 或 false |
%thebridge_arena% |
竞技场名称 |
%thebridge_state% |
WAITING(等待中)、STARTING(开始中)、IN_GAME(游戏中)、ENDING(结束中)、RESETTING(重置中) |
%thebridge_team% |
Red 或 Blue |
%thebridge_team_colored% |
带颜色代码的相同内容,例如 &cRed |
%thebridge_players% / %thebridge_max_players% |
比赛中的玩家数量 / 竞技场最大容量 |
%thebridge_score_red% / %thebridge_score_blue% |
各队的进球数 |
%thebridge_score_own% / %thebridge_score_enemy% |
玩家所在队伍的进球数 / 对方队伍的进球数 |
%thebridge_score_limit% |
获胜所需的进球数 |
%thebridge_countdown% |
当前倒计时的秒数 |
%thebridge_time_left% |
剩余秒数(非进行中的回合时为 0) |
%thebridge_time_left_formatted% |
与 mm:ss 格式相同 |
%thebridge_match_goals% / %thebridge_match_kills% / %thebridge_match_deaths% |
玩家在本场比赛中的数据 |
终身统计数据(任意玩家,在线或离线;需要 stats.enabled):
%thebridge_stats_wins%、_losses(失败)、_goals(进球)、_kills(击杀)、_deaths(死亡)、_matches(场次)、_winstreak(连胜)、_beststreak(最佳连胜)、_kd(击杀死亡比)、_winrate(胜率),例如 %thebridge_stats_wins%。
统计数据在后台读取并缓存 10 秒,因此玩家首次请求时可能会短暂显示为 0。
全服务器范围:
| 占位符 |
值 |
%thebridge_total_players% |
所有比赛中的玩家总数 |
%thebridge_arenas_available% |
当前可加入的竞技场数量 |
%thebridge_arena_players_<arena>% |
该竞技场中的玩家数量 |
%thebridge_arena_max_<arena>% |
该竞技场的最大玩家容量 |
%thebridge_arena_state_<arena>% |
该竞技场的状态 |
手动测试清单
需要真实服务器才能测试的项目(自动化测试未覆盖):
- 插件无错误启用,
/thebridge help 命令正常工作
- 按上述设置 1v1 竞技场,
enable 命令接受该配置
- 两名玩家:倒计时、传送、装备分配、冻结开局
- 进入敌方球门得分,己方球门不得分,不会出现双倍得分
- 玩家击杀、掉出虚空死亡;重生延迟;虚空击杀的击杀归属判定
- 放置和破坏方块:仅允许特定方块,仅在边界内操作,球门区域受保护
- 比赛结束:结算结果,恢复背包/位置,移除桥梁
- 在各状态(等待、倒计时、进行中、结束中)下使用
/thebridge leave 或退出游戏
- 比赛进行中执行
/thebridge disable;或在比赛期间执行 /stop 及插件禁用
- 比赛中杀死服务器进程并重启:竞技场状态恢复,玩家重新加入时获得物品
- 2v2 模式下队友离开
-
match.solo-test: true:一名玩家即可开始比赛,且不写入统计数据
- 比赛结束后执行
/thebridge stats
故障排除
| 问题 |
检查项 |
enable 列出问题 |
修复每一行指出的问题;/thebridge info <arena> 会显示相同的列表 |
| "World ... is not loaded"(世界 ... 未加载) |
TheBridge 启用前必须确保竞技场所在的世界已加载(对于世界插件:请优先加载它们) |
| 控制台中出现 "Arena stays disabled"(竞技场保持禁用状态) |
同上,会在启动时记录日志 |
| 玩家无法放置方块 |
方块必须在 build.allowed-blocks 列表中,位于边界内,且不在球门区域内,同时回合必须正在进行中 |
| 球门不计分 |
你必须进入对方队伍的球门,且球门框必须位于边界内 |
| 玩家立即死亡 |
setbounds 设置的底部即为虚空。请确保其低于你的浮岛 |
| 统计数据提示 "not available"(不可用) |
是否设置了 stats.enabled: true?查看控制台中是否有 SQLite 错误 |
| 桥梁未被移除 |
检查控制台是否有 "Cannot restore a block"(无法恢复方块)报错(通常因世界未加载导致),参见上述限制 |
项目结构
org.kylan1940.thebridge
TheBridge 主类:创建所有内容并连接各部分
arena/ Arena(数据与验证)、ArenaState、ArenaManager(保存/加载)、Point、Region
match/ Match(单局比赛的规则)、MatchManager(运行比赛)、MatchTeam
player/ PlayerSnapshot(保存/恢复玩家状态)、EquipmentGiver(装备发放)
reset/ BlockTracker(追踪变更的方块)、ArenaResetter(还原方块)、BlockKey
stats/ StatsManager(后台线程)、PlayerStats、PlayerResult、MatchRecord
storage/ Storage(接口)、SQLiteStorage、StorageException
command/ BridgeCommand、BridgeTabCompleter
listener/ BlockListener(方块交互)、PlayerListener(移动、伤害、退出)
config/ GameSettings(从 config.yml 校验数值)
message/ MessageUtil(消息、标题、音效)
utils/ ConfigUpdater、LocationUtil
许可证
Apache License 2.0,详见 LICENSE。
Description
TheBridge is a Minecraft Java Server minigame plugin. Two teams (1v1 or 2v2) fight on bridges over the void. Build blocks toward the enemy, fight, and score by entering the enemy goal. First team to the score limit wins. If you have a question, please make an issue.
Changelogs [1.1.0]
- Support 1.13 to 1.21 (now support 1.13 to 26.x)
- Added tutorial video
- Changed Java version
- Changed configuration
Features
- 1v1 and 2v2 (any team size up to
match.max-team-size)
- Multiple arenas, each saved in its own file
- Arena states:
DISABLED, WAITING, STARTING, IN_GAME, ENDING, RESETTING
- Setup validation with clear errors (an arena can't be enabled while something is missing)
- Goal detection without commands, duplicate-goal protection
- Respawn delay, void death, kill credit for void kills
- Configurable equipment, buildable blocks, break rules
- Arena reset: only changed blocks are tracked and restored in small batches
- Crash recovery for players (inventory, location, game mode ...) and for arena blocks
- SQLite statistics (wins, losses, goals, kills, deaths, matches, win streak), saved on a background thread
- Titles, action bar, sounds, optional console-command rewards
- Runs on Spigot, CraftBukkit, Paper and Paper forks
- Permissions and tab completion
Installation
- Download the plugin jar.
- Put it into the plugins folder
- Restart the server
- Create an arena (see Arena setup)
Compatibility
| Server software |
Expected to work? |
Notes |
| Paper, Purpur, Pufferfish, Leaves (1.13 - 1.21) |
Yes |
They contain the Spigot API. |
| Spigot, CraftBukkit (1.13 - 1.21) |
Yes |
CraftBukkit has the same Bukkit API. Spigot-only parts used: the BungeeCord chat API for the action bar and player.spigot().respawn(). A pure CraftBukkit build without the Spigot additions would lack these two. |
| Folia |
No |
TheBridge uses the normal Bukkit scheduler and does not declare folia-supported. |
- "Expected" means the code only calls API that exists there. Only some of these servers have been tested. Please report what works for you.
Commands
Main command: /thebridge (aliases: /tb, /bridge)
| Command |
Description |
Permission |
/thebridge help |
Show the commands |
none |
/thebridge list |
List arenas with state and players |
thebridge.join |
/thebridge join [arena] |
Join an arena (random free one if no name) |
thebridge.join |
/thebridge leave |
Leave your match |
thebridge.leave |
/thebridge stats [player] |
Show statistics |
thebridge.stats |
/thebridge create <arena> |
Create an arena in your current world |
thebridge.admin |
/thebridge setup <arena> |
Open the setup menu (buttons run the commands below) |
thebridge.admin |
/thebridge setlobby <arena> |
Set the waiting room to your position |
thebridge.admin |
/thebridge setspawn <arena> <red|blue> |
Set a team spawn to your position |
thebridge.admin |
/thebridge pos1 / pos2 |
Select two corners (used by setgoal and setbounds) |
thebridge.admin |
/thebridge setgoal <arena> <red|blue> |
Set the goal that team defends = the selected box |
thebridge.admin |
/thebridge setbounds <arena> |
Set the arena box = the selected box (its bottom is the void) |
thebridge.admin |
/thebridge teamsize <arena> <n> |
1 = 1v1, 2 = 2v2 ... |
thebridge.admin |
/thebridge scorelimit <arena> <n> |
Goals to win for this arena (0 = use config.yml) |
thebridge.admin |
/thebridge duration <arena> <seconds> |
Match length for this arena (0 = use config.yml) |
thebridge.admin |
/thebridge enable <arena> |
Validate and open the arena |
thebridge.admin |
/thebridge disable <arena> |
Close the arena (safely cancels a running match) |
thebridge.admin |
/thebridge stop <arena> |
Cancel the running match (no winner, no stats) |
thebridge.admin |
/thebridge info <arena> |
Show the arena setup and any problems |
thebridge.admin |
/thebridge delete <arena> |
Delete a disabled arena |
thebridge.admin |
/thebridge reload |
Reload config.yml (not the arena files) |
thebridge.admin |
Permissions
| Permission |
Default |
Purpose |
thebridge.admin |
OP |
All setup/management commands. Also allows any command during a match. |
thebridge.join |
true |
Join arenas and list them. |
thebridge.leave |
true |
Leave a match. |
thebridge.stats |
true |
View statistics. |
thebridge.bypass |
OP |
Build/break inside an arena that is empty and waiting (for editing the map). It never works for players in a match or inside an arena with a match, on purpose. |
Arena setup example
Build your map first (two islands, a void in between, a goal on each side). Then, standing in the map's world:
/thebridge create lava
/thebridge setlobby lava (stand in the waiting room)
/thebridge setspawn lava red (stand on the red spawn)
/thebridge setspawn lava blue
/thebridge pos1 (stand in one corner of the RED goal)
/thebridge pos2 (stand in the opposite corner)
/thebridge setgoal lava red (red DEFENDS this goal, blue scores here)
/thebridge pos1 (corners of the BLUE goal)
/thebridge pos2
/thebridge setgoal lava blue
/thebridge pos1 (a box around the WHOLE arena, from the void level up to above the highest build height)
/thebridge pos2
/thebridge setbounds lava
/thebridge teamsize lava 1 (1v1; use 2 for 2v2)
/thebridge enable lava
If something is missing, enable tells you exactly what. Players then use /thebridge join lava. The match starts when the arena is full.
Rules of thumb: the bottom of the bounds is the void: falling below it is a death. Spawns must be inside the bounds and not inside a goal. The lobby can be anywhere.
Testing alone (solo test mode)
No friend or second account? Set this in config.yml and run /thebridge reload:
match:
solo-test: true
Then join an arena alone: the countdown starts with one player. You are team RED and score by entering the blue goal. You can test the countdown, goals, void deaths, building rules, bridge reset and the end of the match. You can not test fighting, kills and forfeits (that needs an opponent).
Matches in solo test mode never write to the statistics and never give rewards. The setting is read when a player joins an empty arena, so switch it on or off while no match is waiting. Turn it off again on a real server.
To test with two players on your own PC you can also run a second client with an offline account on a local server (online-mode=false).
Match flow
- Players join; when the arena is full a countdown starts (
match.countdown).
- Teams are assigned, players are teleported and equipped, a short freeze (
match.round-countdown) starts every round.
- Entering the enemy goal scores one point. Players and (optionally) bridges are reset.
- The match ends at
match.score-limit goals, or when match.duration runs out (more goals wins, equal goals = draw).
- Results are shown, players get their old inventory and position back, the arena resets and opens again.
Leaving or disconnecting mid-match counts as leaving: you get your own items back immediately, and if a team has nobody left the other team wins. Rejoining the match is not supported. Rejoining the server after a crash restores your items and position.
Configuration
Everything is in plugins/TheBridge/config.yml (documented inside the file): countdown, duration, score limit, respawn delay, team size limit, allowed blocks, break rules, equipment ({team} becomes RED/BLUE), reset behaviour, statistics, rewards, effects and all messages. Invalid numbers are corrected with a warning in the console. Per-arena values live in plugins/TheBridge/arenas/<name>.yml.
When a new plugin version needs a newer config-version, your old file is renamed to config-<version>.yml and a fresh one is written (same as in my other plugins).
Arena reset limitations
The reset restores the type and block state (rotation, waterlogged, ...) of every block a player placed or broke, a few hundred per tick. It does not restore:
- items inside containers (players can't open containers in a match),
- entities other than dropped items and arrows (those are removed),
- sand/gravel falling, redstone, TNT chains, changes by other plugins or commands. Don't put gravity blocks or redstone in
build.allowed-blocks,
- fluids: buckets are blocked and liquid flow is cancelled inside arenas.
Crash safety: the list of changed blocks is saved to plugins/TheBridge/journals/ every reset.journal-interval seconds. After a crash the arena is restored from it on the next start. Blocks changed in the last few seconds before a crash can be missed.
Statistics
SQLite file plugins/TheBridge/stats.db. All database work runs on one background thread, so the server never waits for the disk. A database problem is logged and never stops a match. The storage code is behind the Storage interface so MySQL/MariaDB can be added later; only SQLite exists now.
PlaceholderAPI
Optional. If PlaceholderAPI is installed, TheBridge registers itself automatically (no /papi ecloud download needed). Use the placeholders in scoreboards, tab lists, holograms and chat plugins.
Placeholders of the match a player is in (empty when the player is not in a match, so a scoreboard can hide the lines):
| Placeholder |
Value |
%thebridge_in_game% |
true or false |
%thebridge_arena% |
Arena name |
%thebridge_state% |
WAITING, STARTING, IN_GAME, ENDING, RESETTING |
%thebridge_team% |
Red or Blue |
%thebridge_team_colored% |
Same with colour code, for example &cRed |
%thebridge_players% / %thebridge_max_players% |
Players in the match / the arena maximum |
%thebridge_score_red% / %thebridge_score_blue% |
Goals of each team |
%thebridge_score_own% / %thebridge_score_enemy% |
Goals of the player's team / the other team |
%thebridge_score_limit% |
Goals needed to win |
%thebridge_countdown% |
Seconds of the running countdown |
%thebridge_time_left% |
Seconds left (0 outside a running round) |
%thebridge_time_left_formatted% |
Same as mm:ss |
%thebridge_match_goals% / %thebridge_match_kills% / %thebridge_match_deaths% |
The player's numbers in this match |
Lifetime statistics (any player, online or not; needs stats.enabled):
%thebridge_stats_wins%, _losses, _goals, _kills, _deaths, _matches, _winstreak, _beststreak, _kd, _winrate, for example %thebridge_stats_wins%.
Stats are read in the background and kept for 10 seconds, so a player's very first request can show 0 for a moment.
Server wide:
| Placeholder |
Value |
%thebridge_total_players% |
Players in any match |
%thebridge_arenas_available% |
Arenas that can be joined right now |
%thebridge_arena_players_<arena>% |
Players in that arena |
%thebridge_arena_max_<arena>% |
Maximum players of that arena |
%thebridge_arena_state_<arena>% |
State of that arena |
Manual test checklist
Things that need a real server (not covered by the automated tests):
- Plugin enables without errors,
/thebridge help works
- Setup of a 1v1 arena as above,
enable accepts it
- Two players: countdown, teleport, equipment, frozen start
- Scoring in the enemy goal, no score in your own goal, no double score
- Death by player, by void; respawn delay; kill credit for a void kill
- Place and break blocks: only allowed blocks, only inside the bounds, goals protected
- End of match: results, inventory/position restored, bridges removed
-
/thebridge leave and quitting in each state (waiting, countdown, running, ending)
-
/thebridge disable during a running match; /stop and plugin disable in the middle of a match
- Kill the server process in a match, restart: arena restored, player gets items back on join
- 2v2 with a teammate leaving
-
match.solo-test: true: one player can start a match and no stats are written
-
/thebridge stats after a match
Troubleshooting
| Problem |
What to check |
enable lists problems |
Fix each line; /thebridge info <arena> shows the same list |
| "World ... is not loaded" |
The arena's world must be loaded before TheBridge enables (world plugins: load them first) |
| "Arena stays disabled" in the console |
Same list as above, logged at startup |
| Players can't place blocks |
The block must be in build.allowed-blocks, inside the bounds, outside the goals and the round must be running |
| Goal doesn't count |
You must enter the goal of the other team, and the goal box must be inside the bounds |
| Players die instantly |
The bottom of setbounds is the void. Make sure it is below your islands |
| Stats say "not available" |
stats.enabled: true? Look for a SQLite error in the console |
| Bridges not removed |
Check the console for "Cannot restore a block" (world unloaded), see limitations above |
Project structure
org.kylan1940.thebridge
TheBridge main class: creates everything, wires it together
arena/ Arena (data + validation), ArenaState, ArenaManager (save/load), Point, Region
match/ Match (the rules of ONE match), MatchManager (runs matches), MatchTeam
player/ PlayerSnapshot (save/restore a player), EquipmentGiver (kits)
reset/ BlockTracker (what changed), ArenaResetter (puts it back), BlockKey
stats/ StatsManager (background thread), PlayerStats, PlayerResult, MatchRecord
storage/ Storage (interface), SQLiteStorage, StorageException
command/ BridgeCommand, BridgeTabCompleter
listener/ BlockListener (building), PlayerListener (moving, damage, quitting)
config/ GameSettings (checked numbers from config.yml)
message/ MessageUtil (messages, titles, sounds)
utils/ ConfigUpdater, LocationUtil
License
Apache License 2.0, see LICENSE.
评论 0
登录后参与评分
还没有评论,来抢沙发吧