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