BabyAxolotlModel.java
net.minecraft.client.model.animal.axolotl.BabyAxolotlModel
信息
- 全限定名:net.minecraft.client.model.animal.axolotl.BabyAxolotlModel
- 类型:public class
- 包:net.minecraft.client.model.animal.axolotl
- 源码路径:src/main/java/net/minecraft/client/model/animal/axolotl/BabyAxolotlModel.java
- 起始行号:L18
- 继承:EntityModel
- 职责:
TODO
字段/常量
-
MAX_WALK_ANIMATION_SPEED- 类型:
float - 修饰符:
private static final - 源码定位:
L19 - 说明:
TODO
- 类型:
-
WALK_ANIMATION_SCALE_FACTOR- 类型:
float - 修饰符:
private static final - 源码定位:
L20 - 说明:
TODO
- 类型:
-
walkAnimation- 类型:
KeyframeAnimation - 修饰符:
private final - 源码定位:
L21 - 说明:
TODO
- 类型:
-
walkUnderwaterAnimation- 类型:
KeyframeAnimation - 修饰符:
private final - 源码定位:
L22 - 说明:
TODO
- 类型:
-
swimAnimation- 类型:
KeyframeAnimation - 修饰符:
private final - 源码定位:
L23 - 说明:
TODO
- 类型:
-
idleOnGroundAnimation- 类型:
KeyframeAnimation - 修饰符:
private final - 源码定位:
L24 - 说明:
TODO
- 类型:
-
idleOnGroundUnderWaterAnimation- 类型:
KeyframeAnimation - 修饰符:
private final - 源码定位:
L25 - 说明:
TODO
- 类型:
-
idleUnderWaterAnimation- 类型:
KeyframeAnimation - 修饰符:
private final - 源码定位:
L26 - 说明:
TODO
- 类型:
-
playDeadAnimation- 类型:
KeyframeAnimation - 修饰符:
private final - 源码定位:
L27 - 说明:
TODO
- 类型:
内部类/嵌套类型
- 无
构造器
public BabyAxolotlModel(ModelPart root) @ L29
- 构造器名:BabyAxolotlModel
- 源码定位:L29
- 修饰符:public
参数:
- root: ModelPart
说明:
TODO
方法
下面的方法块按源码顺序生成。
public static LayerDefinition createBodyLayer() @ L40
- 方法名:createBodyLayer
- 源码定位:L40
- 返回类型:LayerDefinition
- 修饰符:public static
参数:
- 无
说明:
TODO
public void setupAnim(AxolotlRenderState state) @ L104
- 方法名:setupAnim
- 源码定位:L104
- 返回类型:void
- 修饰符:public
参数:
- state: AxolotlRenderState
说明:
TODO
代码
@OnlyIn(Dist.CLIENT)
public class BabyAxolotlModel extends EntityModel<AxolotlRenderState> {
private static final float MAX_WALK_ANIMATION_SPEED = 15.0F;
private static final float WALK_ANIMATION_SCALE_FACTOR = 30.0F;
private final KeyframeAnimation walkAnimation;
private final KeyframeAnimation walkUnderwaterAnimation;
private final KeyframeAnimation swimAnimation;
private final KeyframeAnimation idleOnGroundAnimation;
private final KeyframeAnimation idleOnGroundUnderWaterAnimation;
private final KeyframeAnimation idleUnderWaterAnimation;
private final KeyframeAnimation playDeadAnimation;
public BabyAxolotlModel(ModelPart root) {
super(root);
this.swimAnimation = BabyAxolotlAnimation.BABY_AXOLOTL_SWIM.bake(root);
this.walkAnimation = BabyAxolotlAnimation.AXOLOTL_WALK_FLOOR.bake(root);
this.walkUnderwaterAnimation = BabyAxolotlAnimation.WALK_FLOOR_UNDERWATER.bake(root);
this.idleUnderWaterAnimation = BabyAxolotlAnimation.IDLE_UNDERWATER.bake(root);
this.idleOnGroundUnderWaterAnimation = BabyAxolotlAnimation.IDLE_FLOOR_UNDERWATER.bake(root);
this.idleOnGroundAnimation = BabyAxolotlAnimation.BABY_AXOLOTL_IDLE_FLOOR.bake(root);
this.playDeadAnimation = BabyAxolotlAnimation.BABY_AXOLOTL_PLAY_DEAD.bake(root);
}
public static LayerDefinition createBodyLayer() {
MeshDefinition meshdefinition = new MeshDefinition();
PartDefinition partdefinition = meshdefinition.getRoot();
PartDefinition root = partdefinition.addOrReplaceChild("root", CubeListBuilder.create(), PartPose.offset(0.0F, 24.0F, 0.0F));
PartDefinition body = root.addOrReplaceChild(
"body",
CubeListBuilder.create()
.texOffs(0, 0)
.addBox(-2.0F, -0.75F, -2.75F, 4.0F, 2.0F, 6.0F, new CubeDeformation(0.0F))
.texOffs(0, 12)
.addBox(0.0F, -1.75F, -2.75F, 0.0F, 3.0F, 5.0F, new CubeDeformation(0.0F)),
PartPose.offset(0.0F, -1.25F, 1.75F)
);
body.addOrReplaceChild(
"right_front_leg",
CubeListBuilder.create().texOffs(20, 16).addBox(-3.0F, 0.0F, -0.5F, 3.0F, 0.0F, 1.0F, new CubeDeformation(0.0F)),
PartPose.offset(-2.0F, 0.25F, -1.25F)
);
PartDefinition right_leg = body.addOrReplaceChild(
"right_hind_leg", CubeListBuilder.create(), PartPose.offsetAndRotation(-2.0F, 0.25F, 1.75F, 0.0F, 1.5708F, 1.5708F)
);
right_leg.addOrReplaceChild(
"right_leg_r1",
CubeListBuilder.create().texOffs(20, 14).addBox(0.0F, 0.0F, -0.5F, 3.0F, 0.0F, 1.0F, new CubeDeformation(0.0F)),
PartPose.offsetAndRotation(0.0F, 0.0F, 0.0F, -1.5708F, 0.0F, 1.5708F)
);
body.addOrReplaceChild(
"left_front_leg",
CubeListBuilder.create().texOffs(20, 13).addBox(0.0F, 0.0F, -0.5F, 3.0F, 0.0F, 1.0F, new CubeDeformation(0.0F)),
PartPose.offset(2.0F, 0.25F, -1.25F)
);
body.addOrReplaceChild(
"left_hind_leg",
CubeListBuilder.create().texOffs(20, 14).addBox(0.0F, 0.0F, -0.5F, 3.0F, 0.0F, 1.0F, new CubeDeformation(0.0F)),
PartPose.offset(2.0F, 0.25F, 1.75F)
);
body.addOrReplaceChild(
"tail",
CubeListBuilder.create().texOffs(10, 9).addBox(0.0F, -1.5F, -1.0F, 0.0F, 3.0F, 8.0F, new CubeDeformation(0.0F)),
PartPose.offset(0.0F, -0.25F, 3.25F)
);
PartDefinition head = body.addOrReplaceChild(
"head",
CubeListBuilder.create().texOffs(0, 8).addBox(-3.0F, -2.0F, -4.0F, 6.0F, 3.0F, 4.0F, new CubeDeformation(0.0F)),
PartPose.offset(0.0F, 0.25F, -2.75F)
);
head.addOrReplaceChild(
"left_gills",
CubeListBuilder.create().texOffs(20, 8).addBox(0.0F, -3.5F, 0.0F, 3.0F, 5.0F, 0.0F, new CubeDeformation(0.0F)),
PartPose.offset(3.0F, -0.5F, -2.0F)
);
head.addOrReplaceChild(
"right_gills",
CubeListBuilder.create().texOffs(20, 3).addBox(-3.0F, -3.5F, 0.0F, 3.0F, 5.0F, 0.0F, new CubeDeformation(0.0F)),
PartPose.offset(-3.0F, -0.5F, -2.0F)
);
head.addOrReplaceChild(
"top_gills",
CubeListBuilder.create().texOffs(20, 0).addBox(-3.0F, -3.0F, 0.0F, 6.0F, 3.0F, 0.0F, new CubeDeformation(0.0F)),
PartPose.offset(0.0F, -2.0F, -2.0F)
);
return LayerDefinition.create(meshdefinition, 32, 32);
}
public void setupAnim(AxolotlRenderState state) {
super.setupAnim(state);
if (state.walkAnimationState.isStarted()) {
this.walkAnimation.applyWalk(state.walkAnimationPos, state.walkAnimationSpeed, 15.0F, 30.0F);
}
this.swimAnimation.apply(state.swimAnimation, state.ageInTicks);
this.walkUnderwaterAnimation.apply(state.walkAnimationState, state.ageInTicks);
this.idleOnGroundAnimation.apply(state.idleOnGroundAnimationState, state.ageInTicks);
this.idleUnderWaterAnimation.apply(state.idleUnderWaterAnimationState, state.ageInTicks);
this.idleOnGroundUnderWaterAnimation.apply(state.idleUnderWaterOnGroundAnimationState, state.ageInTicks);
this.playDeadAnimation.apply(state.playDeadAnimationState, state.ageInTicks);
}
}引用的其他类
-
- 引用位置:
字段
- 引用位置:
-
- 引用位置:
继承
- 引用位置:
-
- 引用位置:
参数
- 引用位置:
-
- 引用位置:
方法调用 - 关联成员:
PartPose.offset(), PartPose.offsetAndRotation()
- 引用位置:
-
- 引用位置:
构造调用 - 关联成员:
CubeDeformation()
- 引用位置:
-
- 引用位置:
方法调用 - 关联成员:
CubeListBuilder.create()
- 引用位置:
-
- 引用位置:
方法调用/返回值 - 关联成员:
LayerDefinition.create()
- 引用位置:
-
- 引用位置:
构造调用 - 关联成员:
MeshDefinition()
- 引用位置:
-
- 引用位置:
参数
- 引用位置: