/sharewhereiam

基本信息

属性 值
类型 客户端命令(ClientCommandHandler 注册)
命令名 sharewhereiam
注册类 com.muxiu1997.sharewhereiam.command.CommandWaypointShareLocation
权限等级 0
适用侧 仅客户端

行为

命令以玩家自身位置作为坐标,向所有玩家广播一条 MessageShareWaypoint。这是 Ctrl + Shift + INSERT 的命令版等价行为(参考 WaypointShare 按键)。

流程

  1. 命令体要求参数长度恰好为 0(任何参数都会抛 sharewhereiam.command.sharewhereiam.usage)。
  2. 检查 sender instanceof EntityPlayer,仅在玩家执行时生效(控制台/命令方块无响应)。
  3. 通过 WaypointUtil.waypointOfLocation() 构造 PlayerWaypoint:
    • name = player.getDisplayName()
    • (x, y, z) = 玩家 floor_double(posX/Y/Z)
    • color = 0xFFFFFF(白色)
    • dimension = player.worldObj.provider.dimensionId
  4. 客户端发送 MessageShareWaypoint(playerWaypoint) 到服务端。
  5. 服务端 network.sendToAll(message) 广播给所有客户端。
  6. 每个客户端 WaypointUtil.addShareWaypointChat 在聊天框打印:
    • [JourneyMap] <playerName> shared a waypoint:
    • <name> (<x>, <y>, <z>) [Save] [Edit?] [Toggle]([Edit] 仅 JourneyMap 5 显示)
    • 若 additionalInformation 非空,再多打印一行(VisualProspecting 提示,由 V6 插件在 FullscreenMap 悬停时填入)

行为与按键差异

触发方式 来源 备注
Ctrl + Shift + INSERT(无 GUI、无 Insert 修饰外的 Ctrl) EventHandler#handleKeyInput 等价命令
/sharewhereiam 命令 完全一致
/savewaypoint <base64> 命令 反向操作:把 waypoint code 写入本机

该命令不会调用 WaypointManager.addTransientBeacon(不会渲染世界中的临时 Beacon),也不会触发 WaypointManager.setTemporaryBeacon,仅广播聊天信息 + 可点击按钮。

数值

数值 值
参数长度 0(必须恰好 0)
默认颜色 0xFFFFFF(白色)
默认图标 waypoint-normal.png
默认 Origin JourneyMap
默认 Type Normal

相关条目