TadpoleModel.java
net.minecraft.client.model.animal.frog.TadpoleModel
信息
- 全限定名:net.minecraft.client.model.animal.frog.TadpoleModel
- 类型:public class
- 包:net.minecraft.client.model.animal.frog
- 源码路径:src/main/java/net/minecraft/client/model/animal/frog/TadpoleModel.java
- 起始行号:L17
- 继承:EntityModel
- 职责:
TODO
字段/常量
tail- 类型:
ModelPart - 修饰符:
private final - 源码定位:
L18 - 说明:
TODO
- 类型:
内部类/嵌套类型
- 无
构造器
public TadpoleModel(ModelPart root) @ L20
- 构造器名:TadpoleModel
- 源码定位:L20
- 修饰符:public
参数:
- root: ModelPart
说明:
TODO
方法
下面的方法块按源码顺序生成。
public static LayerDefinition createBodyLayer() @ L25
- 方法名:createBodyLayer
- 源码定位:L25
- 返回类型:LayerDefinition
- 修饰符:public static
参数:
- 无
说明:
TODO
public void setupAnim(LivingEntityRenderState state) @ L36
- 方法名:setupAnim
- 源码定位:L36
- 返回类型:void
- 修饰符:public
参数:
- state: LivingEntityRenderState
说明:
TODO
代码
@OnlyIn(Dist.CLIENT)
public class TadpoleModel extends EntityModel<LivingEntityRenderState> {
private final ModelPart tail;
public TadpoleModel(ModelPart root) {
super(root, RenderTypes::entityCutout);
this.tail = root.getChild("tail");
}
public static LayerDefinition createBodyLayer() {
MeshDefinition mesh = new MeshDefinition();
PartDefinition root = mesh.getRoot();
float xo = 0.0F;
float yo = 22.0F;
float zo = -3.0F;
root.addOrReplaceChild("body", CubeListBuilder.create().texOffs(0, 0).addBox(-1.5F, -1.0F, 0.0F, 3.0F, 2.0F, 3.0F), PartPose.offset(0.0F, 22.0F, -3.0F));
root.addOrReplaceChild("tail", CubeListBuilder.create().texOffs(0, 0).addBox(0.0F, -1.0F, 0.0F, 0.0F, 2.0F, 7.0F), PartPose.offset(0.0F, 22.0F, 0.0F));
return LayerDefinition.create(mesh, 16, 16);
}
public void setupAnim(LivingEntityRenderState state) {
super.setupAnim(state);
float amplitudeMultiplier = state.isInWater ? 1.0F : 1.5F;
this.tail.yRot = -amplitudeMultiplier * 0.25F * Mth.sin(0.3F * state.ageInTicks);
}
}引用的其他类
-
- 引用位置:
继承
- 引用位置:
-
- 引用位置:
参数/字段
- 引用位置:
-
- 引用位置:
方法调用 - 关联成员:
PartPose.offset()
- 引用位置:
-
- 引用位置:
方法调用 - 关联成员:
CubeListBuilder.create()
- 引用位置:
-
- 引用位置:
方法调用/返回值 - 关联成员:
LayerDefinition.create()
- 引用位置:
-
- 引用位置:
构造调用 - 关联成员:
MeshDefinition()
- 引用位置:
-
- 引用位置:
参数
- 引用位置:
-
- 引用位置:
方法调用 - 关联成员:
Mth.sin()
- 引用位置: