SnowGolemRenderer.java
net.minecraft.client.renderer.entity.SnowGolemRenderer
信息
- 全限定名:net.minecraft.client.renderer.entity.SnowGolemRenderer
- 类型:public class
- 包:net.minecraft.client.renderer.entity
- 源码路径:src/main/java/net/minecraft/client/renderer/entity/SnowGolemRenderer.java
- 起始行号:L16
- 继承:MobRenderer<SnowGolem,SnowGolemRenderState,SnowGolemModel>
- 职责:
TODO
字段/常量
-
BLOCK_DISPLAY_CONTEXT- 类型:
BlockDisplayContext - 修饰符:
public static final - 源码定位:
L17 - 说明:
TODO
- 类型:
-
SNOW_GOLEM_LOCATION- 类型:
Identifier - 修饰符:
private static final - 源码定位:
L18 - 说明:
TODO
- 类型:
-
blockModelResolver- 类型:
BlockModelResolver - 修饰符:
private final - 源码定位:
L19 - 说明:
TODO
- 类型:
内部类/嵌套类型
- 无
构造器
public SnowGolemRenderer(EntityRendererProvider.Context context) @ L21
- 构造器名:SnowGolemRenderer
- 源码定位:L21
- 修饰符:public
参数:
- context: EntityRendererProvider.Context
说明:
TODO
方法
下面的方法块按源码顺序生成。
public Identifier getTextureLocation(SnowGolemRenderState state) @ L27
- 方法名:getTextureLocation
- 源码定位:L27
- 返回类型:Identifier
- 修饰符:public
参数:
- state: SnowGolemRenderState
说明:
TODO
public SnowGolemRenderState createRenderState() @ L31
- 方法名:createRenderState
- 源码定位:L31
- 返回类型:SnowGolemRenderState
- 修饰符:public
参数:
- 无
说明:
TODO
public void extractRenderState(SnowGolem entity, SnowGolemRenderState state, float partialTicks) @ L35
- 方法名:extractRenderState
- 源码定位:L35
- 返回类型:void
- 修饰符:public
参数:
- entity: SnowGolem
- state: SnowGolemRenderState
- partialTicks: float
说明:
TODO
代码
@OnlyIn(Dist.CLIENT)
public class SnowGolemRenderer extends MobRenderer<SnowGolem, SnowGolemRenderState, SnowGolemModel> {
public static final BlockDisplayContext BLOCK_DISPLAY_CONTEXT = BlockDisplayContext.create();
private static final Identifier SNOW_GOLEM_LOCATION = Identifier.withDefaultNamespace("textures/entity/snow_golem/snow_golem.png");
private final BlockModelResolver blockModelResolver;
public SnowGolemRenderer(EntityRendererProvider.Context context) {
super(context, new SnowGolemModel(context.bakeLayer(ModelLayers.SNOW_GOLEM)), 0.5F);
this.blockModelResolver = context.getBlockModelResolver();
this.addLayer(new SnowGolemHeadLayer(this));
}
public Identifier getTextureLocation(SnowGolemRenderState state) {
return SNOW_GOLEM_LOCATION;
}
public SnowGolemRenderState createRenderState() {
return new SnowGolemRenderState();
}
public void extractRenderState(SnowGolem entity, SnowGolemRenderState state, float partialTicks) {
super.extractRenderState(entity, state, partialTicks);
if (entity.hasPumpkin()) {
this.blockModelResolver.update(state.headBlock, Blocks.CARVED_PUMPKIN.defaultBlockState(), BLOCK_DISPLAY_CONTEXT);
} else {
state.headBlock.clear();
}
}
}引用的其他类
-
- 引用位置:
构造调用 - 关联成员:
SnowGolemModel()
- 引用位置:
-
- 引用位置:
字段
- 引用位置:
-
- 引用位置:
字段/方法调用 - 关联成员:
BlockDisplayContext.create()
- 引用位置:
-
- 引用位置:
参数
- 引用位置:
-
- 引用位置:
继承
- 引用位置:
-
- 引用位置:
构造调用 - 关联成员:
SnowGolemHeadLayer()
- 引用位置:
-
- 引用位置:
参数/构造调用/返回值 - 关联成员:
SnowGolemRenderState()
- 引用位置:
-
- 引用位置:
字段/方法调用/返回值 - 关联成员:
Identifier.withDefaultNamespace()
- 引用位置:
-
- 引用位置:
参数
- 引用位置: