AsyncRTP
随机传送,绝不卡顿服务器主线程。
展示
大多数 RTP 插件会在服务器刻(tick)的中间加载候选区块。服务器会停下来等待磁盘读取,在租用硬件上这会导致明显的卡顿。300 毫秒的延迟峰值并不罕见。AsyncRTP 将这些工作交给 Paper 的异步区块 API 处理。区块加载时主线程继续运行,只有最后的方块检查和传送本身才会触及主线程。
每个落点都必须通过相同的检查:地面坚实、上方有足够的净空高度,且在周围几个方块内没有岩浆、水、火、仙人掌或其他危险物。不符合条件的落点会被丢弃,并尝试下一个。
此外,它还会维护一个小型的已验证目的地栈,并在服务器空闲时逐个补充。当玩家执行命令时,通常已经有现成的落点可用,因此传送是瞬间完成的,而不是进行多秒的搜索。
与众不同之处
|
AsyncRTP |
典型 RTP 插件 |
| 区块加载 |
异步,不占用主线程 |
同步,阻塞主线程 |
| 目的地 |
预先准备,即时使用 |
按需搜索 |
| 落点检查 |
检查地面、净空高度及周围环境 |
通常只检查地面方块 |
| 失败处理 |
调度下一次尝试,保持主线程空闲 |
在一个刻内循环 |
| 下界 |
从地面向上行走,永远不会落在基岩屋顶 |
经常将玩家传送到天花板 |
| 世界边界 |
半径跟随边界设置 |
固定半径 |
可配置项
全部都可以配置。以下是简要列表。
按权限组。 冷却时间、预热时间、半径、价格和尝试次数预算均可针对每个权限组进行覆盖。未设置的配置项会自动继承。例如,VIP 用户组仅设置 cooldown-seconds: 120,则只会更改这一项,其他保持不变。
按世界。 中心点、最小和最大半径、圆形或方形、高度限制、净空高度、禁止的地面方块、危险方块及其检测半径、禁止或明确允许的生物群系,以及预缓存多少个目的地。未列出的世界将直接拒绝该命令。
搜索模式。 SURFACE 用于主世界,NETHER 用于从地面向上行走并落在屋顶下方,HIGHEST_SOLID 用于忽略高度图并在高度限制内选取最顶部的固体方块。
加入时。 玩家连接时将其投放到野外,可以选择仅在首次加入时或每次加入时投放,并设置延迟以确保客户端先完成加载,还可选择仅对没有重生点的玩家生效。
安全性。 落点附近的岩浆、水、火、仙人掌、岩浆块和浆果丛会导致落点被排除(hazard-radius,默认 2 个方块,列表可编辑)。在玩家被传送前,会再次检查已准备的目的地,以防期间发生变化。支持移动或受伤时取消的预热时间、到达后几秒的伤害免疫、可选的空物品栏槽位检查,以及是否即使搜索失败也启动冷却时间的选项。
表现效果。 出发和到达的声音、粒子类型和数量,以及到达时的标题,均可单独切换。所有面向玩家的文字均位于语言文件中;插件自带英文和德文,其他语言只需复制其中一种即可。
命令
| 命令 |
功能 |
权限 |
/rtp |
传送自己 |
asyncrtp.use(默认:所有人) |
/rtp <player> |
传送其他玩家 |
asyncrtp.other |
/rtp world <name> |
传送到指定世界 |
asyncrtp.world |
/rtp info |
显示已配置的世界及就绪的落点数量 |
asyncrtp.info |
/rtp reload |
重新读取配置文件和语言文件 |
asyncrtp.reload |
别名:/wild, /randomtp。
另有三个独立的绕过权限,以便您可以单独授予而不影响其他权限:asyncrtp.bypass.cooldown、asyncrtp.bypass.warmup 和 asyncrtp.bypass.cost。
可选集成
Vault。 为每次传送收费。如果没有 Vault,插件也能正常运行,且传送保持免费。
PlaceholderAPI。 %asyncrtp_cooldown%、%asyncrtp_cooldown_seconds%、%asyncrtp_ready% 和 %asyncrtp_queue%。
这两者都不是必需的。如果存在,插件会自动检测并使用它们。
要求
Paper 1.21 或更高版本,Java 21 或更高版本。Purpur 和 Folia 也可用,任何基于 Paper API 构建的服务端均可使用。在 Folia 上,每次搜索都会在其所属的区域线程上加载区块,而传送则在玩家所在的线程上运行。不支持纯 Spigot 和 CraftBukkit,因为本插件所依赖的异步区块 API 仅存在于 Paper 中。
AsyncRTP
Random teleport that never stalls the server tick.
Showcase
Most RTP plugins load their candidate chunks in the middle of the tick. The server sits and waits for the disk, and on rented hardware that turns into a visible freeze. Spikes of 300 ms are not unusual. AsyncRTP hands that work to Paper's asynchronous chunk API instead. The tick keeps running while the chunk loads, and only the final block check and the teleport itself touch the main thread.
Every landing spot has to pass the same checks: solid ground, enough free air above it, and no lava, water, fire, cacti or other hazards within a few blocks around it. A spot that fails is dropped and the next one is tried.
On top of that it keeps a small stack of already verified destinations ready, refilled one at a time while the server idles. When a player runs the command, the spot is usually waiting, so the teleport is instant instead of a multi-second search.
Why it is different
|
AsyncRTP |
Typical RTP plugin |
| Chunk loading |
asynchronous, off the tick |
synchronous, blocks the tick |
| Destination |
prepared in advance, instant |
searched on demand |
| Landing spot |
ground, headroom and the area around it checked |
often only the ground block |
| Failed attempt |
schedules the next one, tick stays free |
loops inside one tick |
| Nether |
walks up from the floor, never the bedrock roof |
often drops players on the ceiling |
| World border |
radius follows the border when you want it to |
fixed radius |
What you can configure
Everything. The list below is the short version.
Per rank. Cooldown, warmup, radius, price and attempt budget can each be overridden per permission group. A group inherits anything it does not set, so a VIP entry with just cooldown-seconds: 120 changes exactly that and nothing else.
Per world. Centre, minimum and maximum radius, circle or square, height limits, headroom, blocked ground blocks, hazard blocks and the radius they are checked in, blocked or explicitly allowed biomes, and how many destinations to keep ready. Worlds that are not listed simply reject the command.
Search mode. SURFACE for the overworld, NETHER to walk up from the floor and land under the roof, HIGHEST_SOLID to ignore the height map and take the topmost solid block within the height limits.
On join. Drop players into the wild when they connect, either only on their first ever join or every time, with a delay so the client finishes loading first, and optionally only for players without a respawn point.
Safety. Lava, water, fire, cacti, magma and berry bushes near the landing spot rule it out (hazard-radius, default 2 blocks, list editable). Prepared destinations are checked again right before a player is sent there, in case something changed in the meantime. A warmup that cancels on movement or damage, a few seconds of damage immunity on arrival, an optional check for a free inventory slot, and a choice of whether a failed search should still start the cooldown.
Presentation. Depart and arrival sounds, particle type and count, and the arrival title, each switchable on its own. All player-facing text lives in a language file; English and German ship with the plugin, and any other language is a copy of one of them.
Commands
| Command |
What it does |
Permission |
/rtp |
teleport yourself |
asyncrtp.use (default: everyone) |
/rtp <player> |
teleport somebody else |
asyncrtp.other |
/rtp world <name> |
teleport into a specific world |
asyncrtp.world |
/rtp info |
show configured worlds and how many spots are ready |
asyncrtp.info |
/rtp reload |
re-read config and language file |
asyncrtp.reload |
Aliases: /wild, /randomtp.
Three bypass permissions exist on their own, so you can hand out one without the others: asyncrtp.bypass.cooldown, asyncrtp.bypass.warmup and asyncrtp.bypass.cost.
Optional integrations
Vault. Charge a price per teleport. Without Vault the plugin runs fine and teleports stay free.
PlaceholderAPI. %asyncrtp_cooldown%, %asyncrtp_cooldown_seconds%, %asyncrtp_ready% and %asyncrtp_queue%.
Neither is required. Both are picked up automatically when present.
Requirements
Paper 1.21 or newer, Java 21 or newer. Purpur and Folia work, and so does anything else built on the Paper API. On Folia every search loads its chunks on the region that owns them, and the teleport runs on the player's own thread. Plain Spigot and CraftBukkit are not supported, because the asynchronous chunk API this plugin is built around only exists on Paper.
评论 0
登录后参与评分
还没有评论,来抢沙发吧