CompositeBlockModel.java
net.minecraft.client.renderer.block.model.CompositeBlockModel
信息
- 全限定名:net.minecraft.client.renderer.block.model.CompositeBlockModel
- 类型:public class
- 包:net.minecraft.client.renderer.block.model
- 源码路径:src/main/java/net/minecraft/client/renderer/block/model/CompositeBlockModel.java
- 起始行号:L12
- 实现:BlockModel
- 职责:
TODO
字段/常量
-
normal- 类型:
BlockModel - 修饰符:
private final - 源码定位:
L13 - 说明:
TODO
- 类型:
-
custom- 类型:
BlockModel - 修饰符:
private final - 源码定位:
L14 - 说明:
TODO
- 类型:
内部类/嵌套类型
net.minecraft.client.renderer.block.model.CompositeBlockModel.Unbaked- 类型:
record - 修饰符:
public - 源码定位:
L28 - 说明:
TODO
- 类型:
构造器
public CompositeBlockModel(BlockModel normal, BlockModel custom) @ L16
- 构造器名:CompositeBlockModel
- 源码定位:L16
- 修饰符:public
参数:
- normal: BlockModel
- custom: BlockModel
说明:
TODO
方法
下面的方法块按源码顺序生成。
public void update(BlockModelRenderState output, BlockState blockState, BlockDisplayContext displayContext, long seed) @ L21
- 方法名:update
- 源码定位:L21
- 返回类型:void
- 修饰符:public
参数:
- output: BlockModelRenderState
- blockState: BlockState
- displayContext: BlockDisplayContext
- seed: long
说明:
TODO
代码
@OnlyIn(Dist.CLIENT)
public class CompositeBlockModel implements BlockModel {
private final BlockModel normal;
private final BlockModel custom;
public CompositeBlockModel(BlockModel normal, BlockModel custom) {
this.normal = normal;
this.custom = custom;
}
@Override
public void update(BlockModelRenderState output, BlockState blockState, BlockDisplayContext displayContext, long seed) {
this.normal.update(output, blockState, displayContext, seed);
this.custom.update(output, blockState, displayContext, seed);
}
@OnlyIn(Dist.CLIENT)
public record Unbaked(BlockModel.Unbaked normal, BlockModel.Unbaked custom, Optional<Transformation> transformation) implements BlockModel.Unbaked {
@Override
public BlockModel bake(BlockModel.BakingContext context, Matrix4fc transformation) {
Matrix4fc childTransform = Transformation.compose(transformation, this.transformation);
return new CompositeBlockModel(this.normal.bake(context, childTransform), this.custom.bake(context, childTransform));
}
}
}引用的其他类
-
- 引用位置:
方法调用 - 关联成员:
Transformation.compose()
- 引用位置:
-
- 引用位置:
参数
- 引用位置:
-
- 引用位置:
参数
- 引用位置:
-
- 引用位置:
参数/字段/实现
- 引用位置:
-
- 引用位置:
参数
- 引用位置: