IronGolemRenderer.java
net.minecraft.client.renderer.entity.IronGolemRenderer
信息
- 全限定名:net.minecraft.client.renderer.entity.IronGolemRenderer
- 类型:public class
- 包:net.minecraft.client.renderer.entity
- 源码路径:src/main/java/net/minecraft/client/renderer/entity/IronGolemRenderer.java
- 起始行号:L19
- 继承:MobRenderer<IronGolem,IronGolemRenderState,IronGolemModel>
- 职责:
TODO
字段/常量
-
BLOCK_DISPLAY_CONTEXT- 类型:
BlockDisplayContext - 修饰符:
public static final - 源码定位:
L20 - 说明:
TODO
- 类型:
-
GOLEM_LOCATION- 类型:
Identifier - 修饰符:
private static final - 源码定位:
L21 - 说明:
TODO
- 类型:
-
blockModelResolver- 类型:
BlockModelResolver - 修饰符:
private final - 源码定位:
L22 - 说明:
TODO
- 类型:
内部类/嵌套类型
- 无
构造器
public IronGolemRenderer(EntityRendererProvider.Context context) @ L24
- 构造器名:IronGolemRenderer
- 源码定位:L24
- 修饰符:public
参数:
- context: EntityRendererProvider.Context
说明:
TODO
方法
下面的方法块按源码顺序生成。
public Identifier getTextureLocation(IronGolemRenderState state) @ L31
- 方法名:getTextureLocation
- 源码定位:L31
- 返回类型:Identifier
- 修饰符:public
参数:
- state: IronGolemRenderState
说明:
TODO
public IronGolemRenderState createRenderState() @ L35
- 方法名:createRenderState
- 源码定位:L35
- 返回类型:IronGolemRenderState
- 修饰符:public
参数:
- 无
说明:
TODO
public void extractRenderState(IronGolem entity, IronGolemRenderState state, float partialTicks) @ L39
- 方法名:extractRenderState
- 源码定位:L39
- 返回类型:void
- 修饰符:public
参数:
- entity: IronGolem
- state: IronGolemRenderState
- partialTicks: float
说明:
TODO
protected void setupRotations(IronGolemRenderState state, PoseStack poseStack, float bodyRot, float entityScale) @ L52
- 方法名:setupRotations
- 源码定位:L52
- 返回类型:void
- 修饰符:protected
参数:
- state: IronGolemRenderState
- poseStack: PoseStack
- bodyRot: float
- entityScale: float
说明:
TODO
代码
@OnlyIn(Dist.CLIENT)
public class IronGolemRenderer extends MobRenderer<IronGolem, IronGolemRenderState, IronGolemModel> {
public static final BlockDisplayContext BLOCK_DISPLAY_CONTEXT = BlockDisplayContext.create();
private static final Identifier GOLEM_LOCATION = Identifier.withDefaultNamespace("textures/entity/iron_golem/iron_golem.png");
private final BlockModelResolver blockModelResolver;
public IronGolemRenderer(EntityRendererProvider.Context context) {
super(context, new IronGolemModel(context.bakeLayer(ModelLayers.IRON_GOLEM)), 0.7F);
this.blockModelResolver = context.getBlockModelResolver();
this.addLayer(new IronGolemCrackinessLayer(this));
this.addLayer(new IronGolemFlowerLayer(this));
}
public Identifier getTextureLocation(IronGolemRenderState state) {
return GOLEM_LOCATION;
}
public IronGolemRenderState createRenderState() {
return new IronGolemRenderState();
}
public void extractRenderState(IronGolem entity, IronGolemRenderState state, float partialTicks) {
super.extractRenderState(entity, state, partialTicks);
state.attackTicksRemaining = entity.getAttackAnimationTick() > 0.0F ? entity.getAttackAnimationTick() - partialTicks : 0.0F;
state.offerFlowerTick = entity.getOfferFlowerTick();
if (state.offerFlowerTick > 0) {
this.blockModelResolver.update(state.flowerBlock, Blocks.POPPY.defaultBlockState(), BLOCK_DISPLAY_CONTEXT);
} else {
state.flowerBlock.clear();
}
state.crackiness = entity.getCrackiness();
}
protected void setupRotations(IronGolemRenderState state, PoseStack poseStack, float bodyRot, float entityScale) {
super.setupRotations(state, poseStack, bodyRot, entityScale);
if (!(state.walkAnimationSpeed < 0.01)) {
float p = 13.0F;
float wp = state.walkAnimationPos + 6.0F;
float triangleWave = (Math.abs(wp % 13.0F - 6.5F) - 3.25F) / 3.25F;
poseStack.mulPose(Axis.ZP.rotationDegrees(6.5F * triangleWave));
}
}
}引用的其他类
-
- 引用位置:
参数
- 引用位置:
-
- 引用位置:
构造调用 - 关联成员:
IronGolemModel()
- 引用位置:
-
- 引用位置:
字段
- 引用位置:
-
- 引用位置:
字段/方法调用 - 关联成员:
BlockDisplayContext.create()
- 引用位置:
-
- 引用位置:
参数
- 引用位置:
-
- 引用位置:
继承
- 引用位置:
-
- 引用位置:
构造调用 - 关联成员:
IronGolemCrackinessLayer()
- 引用位置:
-
- 引用位置:
构造调用 - 关联成员:
IronGolemFlowerLayer()
- 引用位置:
-
- 引用位置:
参数/构造调用/返回值 - 关联成员:
IronGolemRenderState()
- 引用位置:
-
- 引用位置:
字段/方法调用/返回值 - 关联成员:
Identifier.withDefaultNamespace()
- 引用位置:
-
- 引用位置:
参数
- 引用位置: