BlockStateModelSet.java
net.minecraft.client.renderer.block.BlockStateModelSet
信息
- 全限定名:net.minecraft.client.renderer.block.BlockStateModelSet
- 类型:public class
- 包:net.minecraft.client.renderer.block
- 源码路径:src/main/java/net/minecraft/client/renderer/block/BlockStateModelSet.java
- 起始行号:L11
- 职责:
TODO
字段/常量
-
modelByState- 类型:
Map<BlockState,BlockStateModel> - 修饰符:
private final - 源码定位:
L12 - 说明:
TODO
- 类型:
-
missingModel- 类型:
BlockStateModel - 修饰符:
private final - 源码定位:
L13 - 说明:
TODO
- 类型:
内部类/嵌套类型
- 无
构造器
public BlockStateModelSet(Map<BlockState,BlockStateModel> modelByState, BlockStateModel missingModel) @ L15
- 构造器名:BlockStateModelSet
- 源码定位:L15
- 修饰符:public
参数:
- modelByState: Map<BlockState,BlockStateModel>
- missingModel: BlockStateModel
说明:
TODO
方法
下面的方法块按源码顺序生成。
public BlockStateModel get(BlockState state) @ L20
- 方法名:get
- 源码定位:L20
- 返回类型:BlockStateModel
- 修饰符:public
参数:
- state: BlockState
说明:
TODO
public BlockStateModel missingModel() @ L24
- 方法名:missingModel
- 源码定位:L24
- 返回类型:BlockStateModel
- 修饰符:public
参数:
- 无
说明:
TODO
public Material.Baked getParticleMaterial(BlockState blockState) @ L28
- 方法名:getParticleMaterial
- 源码定位:L28
- 返回类型:Material.Baked
- 修饰符:public
参数:
- blockState: BlockState
说明:
TODO
代码
@OnlyIn(Dist.CLIENT)
public class BlockStateModelSet {
private final Map<BlockState, BlockStateModel> modelByState;
private final BlockStateModel missingModel;
public BlockStateModelSet(Map<BlockState, BlockStateModel> modelByState, BlockStateModel missingModel) {
this.modelByState = modelByState;
this.missingModel = missingModel;
}
public BlockStateModel get(BlockState state) {
return this.modelByState.getOrDefault(state, this.missingModel);
}
public BlockStateModel missingModel() {
return this.missingModel;
}
public Material.Baked getParticleMaterial(BlockState blockState) {
return this.get(blockState).particleMaterial();
}
}引用的其他类
-
- 引用位置:
参数/字段/返回值
- 引用位置:
-
- 引用位置:
返回值
- 引用位置:
-
- 引用位置:
参数/字段
- 引用位置: