XaeroWaypointManager
Xaero 路点管理
基本信息
| 属性 | 值 |
|---|---|
| 路径 | com.gtnewhorizons.navigator.api.xaero.waypoints.XaeroWaypointManager |
| 行数 | 83(四个路点管理实现里最大) |
| 父类 | WaypointManager(25 行) |
| 状态 | 活动 |
83 行为什么是四个里最大
| 类 | 行 | 目标 |
|---|---|---|
| 本类 | 83 | Xaero |
| JMWaypointManager | 65 | JM5(已废弃) |
| JourneyMapV6WaypointManager | 64 | JM6 |
| VoxelMapWaypointManager | 75 | VoxelMap(死代码) |
⚠️ 83 比 JM6 的 64 多 19 行 ——
多出的部分用于处理
WaypointWithDimension(31 行)
的**「位置 + 维度」打包**:
Xaero 的路点 API 需要把中立
Waypoint 的
blockX/blockY/blockZ + dimensionId(6 个字段)
转成 Xaero 的位置类型 + 维度类型两个对象。
见 WaypointWithDimension 的对照表: 本类(31 行)比中立的 Waypoint(29 行)还多 2 行。
实现三个抽象方法
| 父类抽象方法 | 父类行 |
|---|---|
clearActiveWaypoint() |
:18-19 |
updateActiveWaypoint(Waypoint) |
:21-22 |
hasWaypoint() |
:24-25 |
⚠️ 83 行 / 3 方法 ≈ 27 行/方法, 比 JM5(65 行)与 JM6(64 行)都更重。
覆盖两个 Xaero 地图
⚠️ SupportedMods 有
两个 Xaero 枚举值(XaeroWorldMap / XaeroMiniMap),
而本类的 mod 字段(父类 :10)只持一个
SupportedMods 值。
即:一个 XaeroWaypointManager 实例只服务一个 Xaero 地图,
需要为 Minimap 与 World Map 各注册一次
(InteractableLayerManager 的
addWaypointManager(InteractableLayerManager, SupportedMods)(:58-67)
按 SupportedMods 建 EnumMap 条目)。
关联的 mixin
| mixin | 行 | 目标 |
|---|---|---|
| WaypointsIngameRendererMixin | 50 | WaypointsIngameRenderer(Minimap) |
| MinimapRendererMixin | 130 | MinimapRenderer(Minimap,双模组) |
| GuiMapMixin | 332 | GuiMap(World Map) |
⚠️ 三个 Xaero mixin 里有两个是 Minimap 的 —— Xaero 的游戏内路点渲染主要在 Minimap 侧。
相关
- WaypointWithDimension - 同包,专用的路点打包(31 行)
- WaypointManager - 抽象基类
- Waypoint - 中立路点值对象
- XaeroInteractableLayerRenderer - 渲染侧