Donut RTPQueue
如果你玩过 DonutSMP,你可能了解他们的 RTP 队列。加入队列,等待其他人加入,然后你们俩会被传送到世界中的同一个随机位置。我非常喜欢这个想法,所以我为普通服务器制作了自己的版本。
功能说明
玩家输入 /rtpq 后会弹出一个小型菜单,询问是否确认要与其他玩家随机传送。中间有一把钻石剑,红色面板代表“否”,绿色面板代表“是”。
点击“是”后,玩家会被放入队列。在等待期间,操作栏会显示灰色的“Searching for opponent...”(正在寻找对手...)文字,并随机播放一张音乐唱片(Strad、Wait、Mellohi、Chirp 或 Stal)。我添加音乐是因为无声等待太无聊了。
当另一位玩家加入队列时,搜索会继续进行 3 秒,以便玩家们有片刻时间准备。随后,两人会被传送到相同的随机位置,落地时会播放末影人传送音效。
如果在 80 秒内没有其他人加入,搜索将停止,文字和音乐消失,玩家可以随时再次尝试。
其他值得注意的事项
插件会检查传送地点,确保玩家不会掉进岩浆、水中、仙人掌或其他危险区域。
如果一名玩家在匹配成功后立即离开服务器,另一名玩家不会被卡住,而是继续搜索。
使用俄语作为游戏语言的玩家将看到所有文本均为俄语,其他语言则显示英语。你可以在配置文件中更改这两种语言的所有消息。
更新插件时,旧配置文件会自动更新,你的设置保持不变。同时也会保存旧文件的备份以防万一。
支持的服务端
同一个 jar 文件适用于 Spigot、Paper、Purpur 和 Folia。插件会自动识别你运行的是哪个服务端,无需额外配置。Folia 得到了完整支持,包括其区域线程机制,而不仅仅是标记为兼容。
它适用于 Minecraft 1.21.x 和 26.x。请注意,26.x 服务端需要 Java 25,这是 Minecraft 的要求,并非此插件特有的要求。
我在 Paper 1.21.1 和 26.3、Purpur 1.21.1、1.21.11 和 26.3、Folia 1.21.4、1.21.11 和 26.2,以及 Spigot 26.1.2 和 26.2 上进行了测试。
不支持纯 CraftBukkit。
命令与权限
| 命令 |
作用 |
权限 |
/rtpq |
打开菜单 |
rtpqueue.use(默认所有人可用) |
/rtpqueue |
同上,只是名称更长 |
rtpqueue.use |
/rtpq reload |
重新加载配置 |
rtpqueue.admin(默认仅 OP 可用) |
配置文件
大多数设置一目了然,文件中也有注释。主要设置如下:
YAML
# 玩家被传送到的世界
world: world
# 传送区域
min-x: -2499
max-x: 2499
min-z: -2499
max-z: 2499
# 寻找对手的时间长度(秒)
search-time: 80
# 找到对手与传送之间的延迟(秒)
teleport-delay: 3
# 玩家落地时的音效(与 /playsound 相同的 ID)
teleport-sound: entity.enderman.teleport
# 搜索时可播放的音乐唱片
music:
- strad
- wait
- mellohi
- chirp
- stal
所有消息都在 lang 部分,分为 ru 和 en。带有 & 的颜色代码在所有地方都有效。如果你想禁用某条聊天消息,将其设置为空字符串 "" 即可。
安装
将 jar 文件放入 plugins 文件夹并重启服务器。完成。如果之后修改了配置,请使用 /rtpq reload 应用更改,无需重启服务器。
关于 Spigot 的一点说明
Spigot 没有异步加载区块的方法,因此如果随机生成的位置落在尚未生成的世界部分,服务器可能会短暂卡顿。我将工作分散到多个 tick 中以避免整体冻结,但问题仍然存在。Paper、Purpur 和 Folia 没有这个问题,因此推荐使用其中之一。
反馈
如果发现 bug 或有新功能建议,欢迎告诉我。我很乐意听取它在你的服务器上的表现。
本项目受 DonutSMP 启发,但与 DonutSMP 没有任何关联。
错误/漏洞报告:albekanastoev@gmail.com
Donut RTPQueue
If you've played on DonutSMP, you probably know their RTP Queue. You join the queue, wait for someone else to join, and then both of you get thrown into the same random spot in the world. I really liked that idea, so I made my own version of it for regular servers.
What it does
A player types /rtpq and a small menu pops up asking if they're sure they want to randomly teleport with another player. There's a diamond sword in the middle, a red pane for "No" and a green pane for "Yes".
After clicking "Yes", the player is put into the queue. While they wait, a gray "Searching for opponent..." text shows up in the action bar and a random music disc starts playing (Strad, Wait, Mellohi, Chirp or Stal). I added the music because waiting in silence felt boring.
When someone else joins the queue, the search keeps going for another 3 seconds so the players have a moment to get ready. Then both of them are teleported to the same random location, with the enderman teleport sound when they land.
If nobody shows up within 80 seconds, the search just stops, the text and music go away, and the player can try again whenever they want.
A few other things worth mentioning
The plugin checks where it's teleporting people, so nobody ends up in lava, water, a cactus or anything like that.
If one player leaves the server right after a match is found, the other one doesn't get stuck. They just keep searching.
Players with Russian as their game language see everything in Russian, everyone else gets English. You can change every message for both languages in the config.
When you update the plugin, your old config gets updated automatically and your settings stay the same. A backup of the old file is saved too, just in case.
Supported servers
The same jar works on Spigot, Paper, Purpur and Folia. The plugin figures out which one you're running by itself, so there's nothing to set up. Folia is supported properly, with its region threads, not just marked as compatible.
It works on Minecraft 1.21.x and 26.x. Keep in mind that 26.x servers need Java 25, which is a Minecraft requirement and not something specific to this plugin.
I tested it on Paper 1.21.1 and 26.3, Purpur 1.21.1, 1.21.11 and 26.3, Folia 1.21.4, 1.21.11 and 26.2, and Spigot 26.1.2 and 26.2.
Plain CraftBukkit is not supported.
Commands and permissions
Command What it does Permission
/rtpq Opens the menu rtpqueue.use (everyone by default)
/rtpqueue Same thing, just a longer name rtpqueue.use
/rtpq reload Reloads the config rtpqueue.admin (OP by default)
Config
Most of the settings should be self-explanatory, and there are comments in the file too. The main ones are:
YAML
# World players get teleported to
world: world
# Teleport area
min-x: -2499
max-x: 2499
min-z: -2499
max-z: 2499
# How long to search for an opponent (seconds)
search-time: 80
# Delay between finding an opponent and teleporting (seconds)
teleport-delay: 3
# Sound when players land (same ids as /playsound)
teleport-sound: entity.enderman.teleport
# Music discs that can play while searching
music:
- strad
- wait
- mellohi
- chirp
- stal
All the messages are in the lang section, split into ru and en. Color codes with & work everywhere. If you want to turn a chat message off, set it to an empty string "".
Installation
Drop the jar into your plugins folder and restart the server. That's it. If you change something in the config later, use /rtpq reload to apply it without restarting.
One thing about Spigot
Spigot doesn't have a way to load chunks asynchronously, so if the random location lands in a part of the world that hasn't been generated yet, the server might lag for a moment. I spread the work across several ticks so it's not one big freeze, but it's still there. Paper, Purpur and Folia don't have this problem, so I'd recommend one of those.
Feedback
If you find a bug or have an idea for a feature, feel free to let me know. I'd be happy to hear how it works on your server.
This project is inspired by DonutSMP but is not affiliated with DonutSMP in any way.
For errors / bugs: albekanastoev@gmail.com
评论 0
登录后参与评分
还没有评论,来抢沙发吧