DragonHeadModel .java

net.minecraft.client.model.object.skull.DragonHeadModel (class, 53 lines): members: createHeadLayer, jaw, head, setupAnim. strings: "upper_head", "scale".

net.minecraft.client.model.object.skullclass53 linesclientextends SkullModelBase2.0 KB

API Surface (2)

LayerDefinition createHeadLayer()
void setupAnim(final SkullModelBase.State state)

Fields & Constants (2)

head
jaw

String literals (5)

"head"
"upper_lip"
"upper_head"
"scale"
"nostril"

Full Source

DragonHeadModel.java53 lines · Minecraft 26.3 · verbatim
1
package net.minecraft.client.model.object.skull;
2
3
import net.fabricmc.api.EnvType;
4
import net.fabricmc.api.Environment;
5
import net.minecraft.client.model.geom.ModelPart;
6
import net.minecraft.client.model.geom.PartPose;
7
import net.minecraft.client.model.geom.builders.CubeListBuilder;
8
import net.minecraft.client.model.geom.builders.LayerDefinition;
9
import net.minecraft.client.model.geom.builders.MeshDefinition;
10
import net.minecraft.client.model.geom.builders.PartDefinition;
11
12
@Environment(EnvType.CLIENT)
13
public class DragonHeadModel extends SkullModelBase {
14
	private final ModelPart head;
15
	private final ModelPart jaw;
16
17
	public DragonHeadModel(final ModelPart root) {
18
		super(root);
19
		this.head = root.getChild("head");
20
		this.jaw = this.head.getChild("jaw");
21
	}
22
23
	public static LayerDefinition createHeadLayer() {
24
		MeshDefinition mesh = new MeshDefinition();
25
		PartDefinition root = mesh.getRoot();
26
		float zo = -16.0F;
27
		PartDefinition head = root.addOrReplaceChild(
28
			"head",
29
			CubeListBuilder.create()
30
				.addBox("upper_lip", -6.0F, -1.0F, -24.0F, 12, 5, 16, 176, 44)
31
				.addBox("upper_head", -8.0F, -8.0F, -10.0F, 16, 16, 16, 112, 30)
32
				.mirror(true)
33
				.addBox("scale", -5.0F, -12.0F, -4.0F, 2, 4, 6, 0, 0)
34
				.addBox("nostril", -5.0F, -3.0F, -22.0F, 2, 2, 4, 112, 0)
35
				.mirror(false)
36
				.addBox("scale", 3.0F, -12.0F, -4.0F, 2, 4, 6, 0, 0)
37
				.addBox("nostril", 3.0F, -3.0F, -22.0F, 2, 2, 4, 112, 0),
38
			PartPose.offset(0.0F, -7.986666F, 0.0F).scaled(0.75F)
39
		);
40
		head.addOrReplaceChild(
41
			"jaw", CubeListBuilder.create().texOffs(176, 65).addBox("jaw", -6.0F, 0.0F, -16.0F, 12.0F, 4.0F, 16.0F), PartPose.offset(0.0F, 4.0F, -8.0F)
42
		);
43
		return LayerDefinition.create(mesh, 256, 256);
44
	}
45
46
	public void setupAnim(final SkullModelBase.State state) {
47
		super.setupAnim(state);
48
		this.jaw.xRot = (float)(Math.sin(state.animationPos * (float) Math.PI * 0.2F) + 1.0) * 0.2F;
49
		this.head.yRot = state.yRot * (float) (Math.PI / 180.0);
50
		this.head.xRot = state.xRot * (float) (Math.PI / 180.0);
51
	}
52
}
53

Decompiled Minecraft 26.3 source of DragonHeadModel (net/minecraft/client/model/object/skull/DragonHeadModel.java) with Mojang official mappings, stored verbatim on the site.