# MightyRTP v1.0.4
> **警告**: 在有问题的世界(如CaveBlock或洞穴生成的地图)中谨慎使用本插件,因为可能导致服务器崩溃。 **强烈建议** 在配置文件中将这些世界列入黑名单。
## 功能
- **智能地表检测**: 使用智能地形扫描自动发现安全、随机位置,而不是任意的Y坐标
- **高级安全系统**: 包含可配置严格程度(1-5等级)的全面安全检查
- **性能优化**: 异步传送搜索可防止服务器延迟和TPS下降
- **世界管理**: 灵活的世界限制和黑名单
- **冷却系统**: 可配置的使用限制,并具有绕过权限
- **丰富消息**: 可定制的标题、副标题和聊天消息,支持MiniMessage
- **易于配置**: 所有方面的广泛配置选项
- **玩家管理**: 使用适当的权限检查传送其他玩家
- **用户体验**: 智能制表符自动完成和直观的命令结构
- **稳定性能**: 无更多区块加载操作导致服务器崩溃
## 快速开始
### 安装
1. 从发行版下载最新JAR文件
2. 将其放置在服务器的 `plugins` 文件夹中
3. 重新启动您的服务器
4. 使用生成的配置文件配置插件
### 基本用法
- `/rtp` - 传送至随机安全位置
- `/rtp [玩家]` - 传送另一个玩家(需要权限)
- `/rtp [玩家] [世界]` - 传送另一个玩家到指定世界(需要权限)
- `/rtp-reload` - 重新加载插件配置(需要权限)
## 命令
**`/rtp`**
- 描述: 传送至随机安全位置
- 权限: `mightyrtp.rtp`
- 用法: `/rtp`
**`/rtp [玩家]`**
- 描述: 传送另一个玩家
- 权限: `mightyrtp.rtp.other`
- 用法: `/rtp <玩家>`
**`/rtp [玩家] [世界]`**
- 描述: 传送另一个玩家或您自己到指定世界
- 权限: `mightyrtp.rtp.other` + `mightyrtp.rtp.world`
- 用法: `/rtp <玩家> <世界>`
**`/rtp-reload`**
- 描述: 重新加载配置
- 权限: `mightyrtp.reload`
- 用法: `/rtp-reload`
## 权限
**`mightyrtp.rtp`**
- 描述: 允许玩家使用 /rtp 命令
- 默认值: `true`
**`mightyrtp.rtp.other`**
- 描述: 允许玩家使用 /rtp 命令对其他玩家
- 默认值: `op`
**`mightyrtp.rtp.world`**
- 描述: 允许玩家使用 /rtp 命令并指定世界
- 默认值: `op`
**`mightyrtp.bypass`**
- 描述: 允许玩家绕过冷却限制
- 默认值: `op`
**`mightyrtp.reload`**
- 描述: 允许玩家重新加载插件配置
- 默认值: `op`
### 配置文件 (config.yml)
```yaml
# /rtp 命令禁用的世界
# 区分大小写
blacklisted-worlds:
- "world_nether"
- "world_the_end"
# 随机传送器距离(边界限制)
# 这将玩家保持在世界中心(0,0)的±distance 范围内
# 设置为 -1 以禁用边界限制
teleport-distance: 5000
# 从世界中心 (0,0) 的最小距离(防止传送离中心太近)
min-distance-from-spawn: 200
# 冷却设置。拥有 mightyrtp.bypass 权限的用户会忽略此功能。
cooldown:
# 启用/禁用冷却系统
enabled: true
# 用户在冷却窗口期内可以执行命令的次数
max-uses: 10
# 冷却时间窗口(分钟)
time-window: 10
# 标题设置
titles:
# 启用/禁用传送时的标题消息
enabled: true
# 启用/禁用在控制台 RTP 命令中显示标题消息(推荐:为了获得良好的传送体验,设置为 false)
show-for-console: false
# 调试设置
debug:
# 启用/禁用调试日志以进行故障排除
enabled: false
# 在搜索安全位置时,每 N 次尝试记录一次(数字越小,信息越详细)
log-attempt-interval: 10
# 性能设置
performance:
# 使用异步传送位置搜索(推荐:true)
# 这可防止插件阻塞主服务器线程
async-teleport-search: true
# 单次尝试的最大搜索时间(毫秒)(防止在单个位置挂起)
max-search-time-per-attempt: 50
# 对于控制台命令的快速模式 - 跳过区块加载以获得最大速度(推荐:true)
fast-mode-enabled: true
# 快速模式下的最大尝试次数(数字越小,速度越快,但不太彻底)
fast-mode-max-attempts: 5
# 快速模式安全等级(1=基本不安全区块检查, 2=+上方有空气, 3=全部安全)
fast-mode-safety-level: 2
# 传送的安全设置
safety:
# 安全检查应有多严格 (1-5, 1=非常严格, 5=非常宽松)
strictness: 3
# 寻找安全位置的最大尝试次数
max-attempts: 50
# 不安全区块类型(被认为传送时不安全的区块)
unsafe-blocks:
- "WATER"
- "LAVA"
- "CACTUS"
- "FIRE"
- "VOID_AIR"
- "CAVE_AIR"
- "POWDER_SNOW"
- "MAGMA_BLOCK"
- "SWEET_BERRY_BUSH"
```
### 消息 (messages.yml)
#### 标题配置
```yaml
# 标题消息(执行 /rtp 时显示)
title:
text: "Teleporting please wait... "
# 注意: 颜色和格式通过文本字段中的标签进行处理
# 副标题消息(显示在标题下方)
subtitle:
text: "Good luck out there! "
# 注意: 颜色和格式通过文本字段中的标签进行处理
```
#### 聊天消息
```yaml
messages:
teleporting: "Finding a safe location... "
teleported: "You have been teleported to a random location! "
no-safe-location: "Could not find a safe location. Please try again! "
world-blacklisted: "Random teleport is disabled in this world! "
reload-success: "Configuration reloaded successfully! "
reload-failed: "Failed to reload configuration! "
no-permission: "You don't have permission to use this command! "
cooldown-exceeded: "You have exceeded the cooldown limit! You can use this command again in {time}. "
cooldown-remaining: "You can use this command {remaining} more times within the next {time} minutes. "
bypass-active: "Bypass permission active - unlimited teleports! "
player-not-found: "Player not found: {player} "
teleporting-other: "Teleporting {player} to a random location... "
teleported-other: "Successfully teleported {player} to a random location! "
no-safe-location-other: "Could not find a safe location for {player} "
```
## 故障排除
### 常见问题
**插件无法找到安全位置:**
- 增加 config 中的 `max-attempts`
- 验证世界生成是否正常工作
- 考虑调整 `safety.strictness`(更低 = 更严格,更高 = 更宽松)
**传送时服务器出现延迟:**
- 确保启用 `async-teleport-search: true`
- 如果需要,减少 `max-attempts`
- 检查服务器性能设置
**区块加载错误:**
- 确保服务器有足够的 RAM
- 检查世界生成是否已启用
- 确保具有正确的服务器权限
### 性能提示
- **普通世界**: 默认设置效果良好
- **复杂的地形**: 将 `max-attempts` 增加到 75-100
- **洞穴世界**: 将 `safety.strictness` 设置为 4-5 以获得更宽松的放置,但 **强烈建议屏蔽这些世界**。
- **高流量服务器**: 将 `max-attempts` 保持在适度水平(50-75)以平衡成功率和性能
## 支持
如果您需要帮助或有建议,请在 GitHub 仓库中打开一个 issue,或加入链接的 Discord 并导航到 # plugin-help
## 贡献
欢迎贡献!随时提交 Pull Request。对于重大更改,请先打开一个 issue 以讨论您想要进行哪些更改。
---