/toggletempbeacon
基本信息
| 属性 | 值 |
|---|---|
| 类型 | 客户端命令(ClientCommandHandler 注册) |
| 命令名 | toggletempbeacon |
| 注册类 | com.muxiu1997.sharewhereiam.command.CommandWaypointToggleTempBeacon |
| 权限等级 | 0 |
| 适用侧 | 仅客户端 |
行为
切换 JourneyMap 中的「临时 Beacon」状态。临时 Beacon 是一个非持久化的 Waypoint,通过 JourneyMap 6 的 IClientAPI 显示。
参数
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
[waypoint code] |
Base64 编码字符串 | 否 | 待切换为临时 Beacon 的 Waypoint |
参数数量 0 与 1 都允许(ensureArgsLength(args, 0, 1))。
行为分支
0 个参数:/toggletempbeacon
- 调用
WaypointManager.clearActiveTempBeacon()。 - 把
WaypointManager.tempBeacon设为null,并对 JourneyMap 调用:- V5:
JourneyMapIntegration.setTemporaryBeacon(null)是空操作(V5 分支未实现)。 - V6:
JourneyMapV6Plugin.setTemporaryBeacon(null)→ 先api.removeWaypoint移除旧的temporaryBeacon,然后temporaryBeacon = null。
- V5:
1 个参数:/toggletempbeacon <base64>
- 用
parseWaypoint(args[0])解码 Base64(解码失败抛Invalid waypoint code)。 - 调用
WaypointManager.toggleActiveTempBeacon(waypoint):- 若
waypoint.equals(tempBeacon)→ 清空当前临时 Beacon(见上)。 - 否则 →
tempBeacon = waypoint,并调用JourneyMapIntegration.setTemporaryBeacon(waypoint)。
- 若
- JourneyMap 6 中
setTemporaryBeacon会:- 调用
WaypointFactory.createWaypoint创建一个persistent=false的 Waypoint。 - 通过
addTemporaryWaypoint加入一个名为Share Where I Am temporary的WaypointGroup(若不存在则自动创建)。 - 设置
setShowOnMap(false)/setShowInWorld(true)/setShowBeacon(true)。
- 调用
- JourneyMap 5 中
setTemporaryBeacon是空操作(V5 分支未实现)——临时 Beacon 概念仅在 JM 6 中存在。
数值
| 数值 | 值 |
|---|---|
| 参数最小长度 | 0 |
| 参数最大长度 | 1 |
| 临时 Beacon Group 名 | Share Where I Am temporary |
临时 Waypoint persistent |
false |
临时 Waypoint showOnMap |
false |
临时 Waypoint showInWorld |
true |
临时 Waypoint showBeacon |
true |
触发来源
该命令通常由聊天中 [Toggle] 按钮触发:
/toggletempbeacon <base64>把一个已分享的 Waypoint 切换为临时 Beacon。