WaypointStyleManager.java
net.minecraft.client.resources.WaypointStyleManager
信息
- 全限定名:net.minecraft.client.resources.WaypointStyleManager
- 类型:public class
- 包:net.minecraft.client.resources
- 源码路径:src/main/java/net/minecraft/client/resources/WaypointStyleManager.java
- 起始行号:L20
- 继承:SimpleJsonResourceReloadListener
- 职责:
TODO
字段/常量
-
ASSET_LISTER- 类型:
FileToIdConverter - 修饰符:
private static final - 源码定位:
L21 - 说明:
TODO
- 类型:
-
MISSING- 类型:
WaypointStyle - 修饰符:
private static final - 源码定位:
L22 - 说明:
TODO
- 类型:
-
waypointStyles- 类型:
Map<ResourceKey<WaypointStyleAsset>,WaypointStyle> - 修饰符:
private - 源码定位:
L23 - 说明:
TODO
- 类型:
内部类/嵌套类型
- 无
构造器
public WaypointStyleManager() @ L25
- 构造器名:WaypointStyleManager
- 源码定位:L25
- 修饰符:public
参数:
- 无
说明:
TODO
方法
下面的方法块按源码顺序生成。
protected void apply(Map<Identifier,WaypointStyle> preparations, ResourceManager manager, ProfilerFiller profiler) @ L29
- 方法名:apply
- 源码定位:L29
- 返回类型:void
- 修饰符:protected
参数:
- preparations: Map<Identifier,WaypointStyle>
- manager: ResourceManager
- profiler: ProfilerFiller
说明:
TODO
public WaypointStyle get(ResourceKey<WaypointStyleAsset> id) @ L35
- 方法名:get
- 源码定位:L35
- 返回类型:WaypointStyle
- 修饰符:public
参数:
- id: ResourceKey
说明:
TODO
代码
@OnlyIn(Dist.CLIENT)
public class WaypointStyleManager extends SimpleJsonResourceReloadListener<WaypointStyle> {
private static final FileToIdConverter ASSET_LISTER = FileToIdConverter.json("waypoint_style");
private static final WaypointStyle MISSING = new WaypointStyle(0, 1, List.of(MissingTextureAtlasSprite.getLocation()));
private Map<ResourceKey<WaypointStyleAsset>, WaypointStyle> waypointStyles = Map.of();
public WaypointStyleManager() {
super(WaypointStyle.CODEC, ASSET_LISTER);
}
protected void apply(Map<Identifier, WaypointStyle> preparations, ResourceManager manager, ProfilerFiller profiler) {
this.waypointStyles = preparations.entrySet()
.stream()
.collect(Collectors.toUnmodifiableMap(e -> ResourceKey.create(WaypointStyleAssets.ROOT_ID, e.getKey()), Entry::getValue));
}
public WaypointStyle get(ResourceKey<WaypointStyleAsset> id) {
return this.waypointStyles.getOrDefault(id, MISSING);
}
}引用的其他类
-
- 引用位置:
方法调用 - 关联成员:
MissingTextureAtlasSprite.getLocation()
- 引用位置:
-
- 引用位置:
参数/字段/构造调用/返回值 - 关联成员:
WaypointStyle()
- 引用位置:
-
- 引用位置:
字段/方法调用 - 关联成员:
FileToIdConverter.json()
- 引用位置:
-
- 引用位置:
参数
- 引用位置:
-
- 引用位置:
参数/字段/方法调用 - 关联成员:
ResourceKey.create()
- 引用位置:
-
- 引用位置:
参数
- 引用位置:
-
SimpleJsonResourceReloadListener
- 引用位置:
继承
- 引用位置:
-
- 引用位置:
参数
- 引用位置:
-
- 引用位置:
参数/字段
- 引用位置: