SkullSpecialRenderer.java
net.minecraft.client.renderer.special.SkullSpecialRenderer
信息
- 全限定名:net.minecraft.client.renderer.special.SkullSpecialRenderer
- 类型:public class
- 包:net.minecraft.client.renderer.special
- 源码路径:src/main/java/net/minecraft/client/renderer/special/SkullSpecialRenderer.java
- 起始行号:L21
- 实现:NoDataSpecialModelRenderer
- 职责:
TODO
字段/常量
-
model- 类型:
SkullModelBase - 修饰符:
private final - 源码定位:
L22 - 说明:
TODO
- 类型:
-
animation- 类型:
float - 修饰符:
private final - 源码定位:
L23 - 说明:
TODO
- 类型:
-
renderType- 类型:
RenderType - 修饰符:
private final - 源码定位:
L24 - 说明:
TODO
- 类型:
内部类/嵌套类型
net.minecraft.client.renderer.special.SkullSpecialRenderer.Unbaked- 类型:
record - 修饰符:
public - 源码定位:
L47 - 说明:
TODO
- 类型:
构造器
public SkullSpecialRenderer(SkullModelBase model, float animation, RenderType renderType) @ L26
- 构造器名:SkullSpecialRenderer
- 源码定位:L26
- 修饰符:public
参数:
- model: SkullModelBase
- animation: float
- renderType: RenderType
说明:
TODO
方法
下面的方法块按源码顺序生成。
public void submit(PoseStack poseStack, SubmitNodeCollector submitNodeCollector, int lightCoords, int overlayCoords, boolean hasFoil, int outlineColor) @ L32
- 方法名:submit
- 源码定位:L32
- 返回类型:void
- 修饰符:public
参数:
- poseStack: PoseStack
- submitNodeCollector: SubmitNodeCollector
- lightCoords: int
- overlayCoords: int
- hasFoil: boolean
- outlineColor: int
说明:
TODO
public void getExtents(Consumer<Vector3fc> output) @ L37
- 方法名:getExtents
- 源码定位:L37
- 返回类型:void
- 修饰符:public
参数:
- output: Consumer
说明:
TODO
代码
@OnlyIn(Dist.CLIENT)
public class SkullSpecialRenderer implements NoDataSpecialModelRenderer {
private final SkullModelBase model;
private final float animation;
private final RenderType renderType;
public SkullSpecialRenderer(SkullModelBase model, float animation, RenderType renderType) {
this.model = model;
this.animation = animation;
this.renderType = renderType;
}
@Override
public void submit(PoseStack poseStack, SubmitNodeCollector submitNodeCollector, int lightCoords, int overlayCoords, boolean hasFoil, int outlineColor) {
SkullBlockRenderer.submitSkull(this.animation, poseStack, submitNodeCollector, lightCoords, this.model, this.renderType, outlineColor, null);
}
@Override
public void getExtents(Consumer<Vector3fc> output) {
PoseStack poseStack = new PoseStack();
SkullModelBase.State modelState = new SkullModelBase.State();
modelState.animationPos = this.animation;
this.model.setupAnim(modelState);
this.model.root().getExtentsForGui(poseStack, output);
}
@OnlyIn(Dist.CLIENT)
public record Unbaked(SkullBlock.Type kind, Optional<Identifier> textureOverride, float animation) implements NoDataSpecialModelRenderer.Unbaked {
public static final MapCodec<SkullSpecialRenderer.Unbaked> MAP_CODEC = RecordCodecBuilder.mapCodec(
i -> i.group(
SkullBlock.Type.CODEC.fieldOf("kind").forGetter(SkullSpecialRenderer.Unbaked::kind),
Identifier.CODEC.optionalFieldOf("texture").forGetter(SkullSpecialRenderer.Unbaked::textureOverride),
Codec.FLOAT.optionalFieldOf("animation", 0.0F).forGetter(SkullSpecialRenderer.Unbaked::animation)
)
.apply(i, SkullSpecialRenderer.Unbaked::new)
);
public Unbaked(SkullBlock.Type kind) {
this(kind, Optional.empty(), 0.0F);
}
@Override
public MapCodec<SkullSpecialRenderer.Unbaked> type() {
return MAP_CODEC;
}
public @Nullable SkullSpecialRenderer bake(SpecialModelRenderer.BakingContext context) {
SkullModelBase model = SkullBlockRenderer.createModel(context.entityModelSet(), this.kind);
Identifier textureOverride = this.textureOverride.<Identifier>map(t -> t.withPath(p -> "textures/entity/" + p + ".png")).orElse(null);
if (model == null) {
return null;
} else {
RenderType renderType = SkullBlockRenderer.getSkullRenderType(this.kind, textureOverride);
return new SkullSpecialRenderer(model, this.animation, renderType);
}
}
}
}引用的其他类
-
- 引用位置:
参数/构造调用 - 关联成员:
PoseStack()
- 引用位置:
-
- 引用位置:
参数/字段/方法调用/构造调用 - 关联成员:
SkullModelBase.State(), State()
- 引用位置:
-
- 引用位置:
参数
- 引用位置:
-
- 引用位置:
方法调用 - 关联成员:
SkullBlockRenderer.createModel(), SkullBlockRenderer.getSkullRenderType(), SkullBlockRenderer.submitSkull()
- 引用位置:
-
- 引用位置:
参数/字段
- 引用位置:
-
- 引用位置:
实现
- 引用位置: