Skip to content

Commit 0600b39

Browse files
committed
Update kart model and textures.
Signed-off-by: 秋雨落 <[email protected]>
1 parent 1b6c657 commit 0600b39

File tree

5 files changed

+63
-33
lines changed

5 files changed

+63
-33
lines changed

src/main/java/org/teacon/powertool/client/renders/entity/model/MartingCarEntityModel.java

Lines changed: 62 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -19,23 +19,37 @@ public class MartingCarEntityModel<T extends MartingCarEntity> extends EntityMod
1919
public static final ModelLayerLocation LAYER_GREEN = new ModelLayerLocation(ResourceLocation.fromNamespaceAndPath(PowerTool.MODID, "marting_car_blue"), "main");
2020

2121
private final ModelPart kart;
22-
private final ModelPart steering_inner; // Mut Y
23-
private final ModelPart front_wheels; // Front wheels Mut X
24-
private final ModelPart wheel; // Right-front Mut Y
25-
private final ModelPart wheel2; // Left-front Mut Y
26-
private final ModelPart rear_wheels; // Back wheels Mut X
27-
private final ModelPart wheel3; // Left-back
28-
private final ModelPart wheel4; // Right-back
22+
private final ModelPart seat;
23+
private final ModelPart steering;
24+
private final ModelPart inner;
25+
private final ModelPart main_frame;
26+
private final ModelPart right_arm;
27+
private final ModelPart left_arm;
28+
private final ModelPart front_wheels;
29+
private final ModelPart wheel;
30+
private final ModelPart wheel2;
31+
private final ModelPart rear_wheels;
32+
private final ModelPart wheel3;
33+
private final ModelPart wheel4;
34+
private final ModelPart axis;
35+
private final ModelPart player;
2936

3037
public MartingCarEntityModel(ModelPart root) {
3138
this.kart = root.getChild("kart");
32-
this.steering_inner = this.kart.getChild("steering_outer").getChild("steering_inner");
39+
this.seat = this.kart.getChild("seat");
40+
this.steering = this.kart.getChild("steering");
41+
this.inner = this.steering.getChild("inner");
42+
this.main_frame = this.kart.getChild("main_frame");
43+
this.right_arm = this.kart.getChild("right_arm");
44+
this.left_arm = this.kart.getChild("left_arm");
3345
this.front_wheels = this.kart.getChild("front_wheels");
3446
this.wheel = this.front_wheels.getChild("wheel");
3547
this.wheel2 = this.front_wheels.getChild("wheel2");
3648
this.rear_wheels = this.kart.getChild("rear_wheels");
3749
this.wheel3 = this.rear_wheels.getChild("wheel3");
3850
this.wheel4 = this.rear_wheels.getChild("wheel4");
51+
this.axis = this.kart.getChild("axis");
52+
this.player = root.getChild("player");
3953
}
4054

4155
public static LayerDefinition createBodyLayer() {
@@ -48,10 +62,9 @@ public static LayerDefinition createBodyLayer() {
4862

4963
PartDefinition cube_r1 = seat.addOrReplaceChild("cube_r1", CubeListBuilder.create().texOffs(0, 0).addBox(-5.0F, -11.0F, -2.0F, 10.0F, 11.0F, 2.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(0.0F, -3.0F, 7.0F, -0.2618F, 0.0F, 0.0F));
5064

51-
PartDefinition steering_outer = kart.addOrReplaceChild("steering_outer", CubeListBuilder.create(), PartPose.offsetAndRotation(0.0F, -11.9497F, -6.2218F, -0.7854F, 0.0F, 0.0F));
65+
PartDefinition steering = kart.addOrReplaceChild("steering", CubeListBuilder.create().texOffs(0, 22).addBox(-2.0F, -1.0F, -1.0F, 4.0F, 2.0F, 2.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(0.0F, -11.9497F, -6.2218F, -0.7854F, 0.0F, 0.0F));
5266

53-
PartDefinition steering_inner = steering_outer.addOrReplaceChild("steering_inner", CubeListBuilder.create().texOffs(37, 7).addBox(-6.0F, 0.0F, -3.0F, 12.0F, 0.0F, 6.0F, new CubeDeformation(0.0F))
54-
.texOffs(0, 22).addBox(-2.0F, -1.0F, -1.0F, 4.0F, 2.0F, 2.0F, new CubeDeformation(0.0F)), PartPose.ZERO);
67+
PartDefinition inner = steering.addOrReplaceChild("inner", CubeListBuilder.create().texOffs(37, 7).addBox(-6.0F, 0.0F, -3.0F, 12.0F, 0.0F, 6.0F, new CubeDeformation(0.0F)), PartPose.offset(0.0F, 0.0F, 0.0F));
5568

5669
PartDefinition main_frame = kart.addOrReplaceChild("main_frame", CubeListBuilder.create().texOffs(0, 0).addBox(-3.5F, -0.2929F, -6.0F, 8.0F, 2.0F, 27.0F, new CubeDeformation(0.0F))
5770
.texOffs(29, 33).addBox(-7.5F, -0.2929F, 8.0F, 16.0F, 1.0F, 5.0F, new CubeDeformation(0.0F))
@@ -80,38 +93,55 @@ public static LayerDefinition createBodyLayer() {
8093

8194
PartDefinition cube_r9 = left_arm.addOrReplaceChild("cube_r9", CubeListBuilder.create().texOffs(20, 51).mirror().addBox(-3.0F, -3.0F, 0.0F, 4.0F, 2.0F, 5.0F, new CubeDeformation(0.0F)).mirror(false), PartPose.offsetAndRotation(0.0F, -0.2929F, 20.2929F, 0.7854F, 0.0F, 0.0F));
8295

83-
//TODO[xkball] 你这轮胎怎么还有缝啊
8496
PartDefinition front_wheels = kart.addOrReplaceChild("front_wheels", CubeListBuilder.create(), PartPose.offset(0.0F, -2.5F, -8.0F));
8597

86-
PartDefinition cube_r10 = front_wheels.addOrReplaceChild("cube_r10", CubeListBuilder.create().texOffs(0, 29).addBox(-11.5F, -1.0F, -1.0F, 23.0F, 2.0F, 2.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(0.0F, 0.0F, 0.0F, -0.7854F, 0.0F, 0.0F));
87-
88-
PartDefinition wheel = front_wheels.addOrReplaceChild("wheel", CubeListBuilder.create().texOffs(20, 44).addBox(-2.0F, -1.0355F, -2.5F, 4.0F, 2.0711F, 5.0F, new CubeDeformation(0.0F))
98+
PartDefinition wheel = front_wheels.addOrReplaceChild("wheel", CubeListBuilder.create().texOffs(0, 67).addBox(-2.0F, -1.0355F, -2.5F, 4.0F, 2.0711F, 5.0F, new CubeDeformation(0.0F))
8999
.texOffs(0, 60).addBox(-2.0F, -2.5F, -1.0355F, 4.0F, 5.0F, 2.0711F, new CubeDeformation(0.0F)), PartPose.offset(-9.0F, 0.0F, 0.0F));
90100

91-
PartDefinition octagon_r1 = wheel.addOrReplaceChild("octagon_r1", CubeListBuilder.create().texOffs(61, 13).addBox(-2.0F, -2.5F, -1.0355F, 4.0F, 5.0F, 2.0711F, new CubeDeformation(0.0F))
92-
.texOffs(38, 45).addBox(-2.0F, -1.0355F, -2.5F, 4.0F, 2.0711F, 5.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(0.0F, 0.0F, 0.0F, -0.7854F, 0.0F, 0.0F));
101+
PartDefinition octagon_r1 = wheel.addOrReplaceChild("octagon_r1", CubeListBuilder.create().texOffs(0, 60).addBox(-2.0F, -2.5F, -1.0355F, 4.0F, 5.0F, 2.0711F, new CubeDeformation(0.0F))
102+
.texOffs(0, 67).addBox(-2.0F, -1.0355F, -2.5F, 4.0F, 2.0711F, 5.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(0.0F, 0.0F, 0.0F, -0.7854F, 0.0F, 0.0F));
93103

94-
PartDefinition wheel2 = front_wheels.addOrReplaceChild("wheel2", CubeListBuilder.create().texOffs(20, 44).mirror().addBox(-2.0F, -1.0355F, -2.5F, 4.0F, 2.0711F, 5.0F, new CubeDeformation(0.0F)).mirror(false)
95-
.texOffs(0, 60).mirror().addBox(-2.0F, -2.5F, -1.0355F, 4.0F, 5.0F, 2.0711F, new CubeDeformation(0.0F)).mirror(false), PartPose.offset(9.0F, 0.0F, 0.0F));
104+
PartDefinition wheel2 = front_wheels.addOrReplaceChild("wheel2", CubeListBuilder.create().texOffs(0, 67).addBox(-2.0F, -1.0355F, -2.5F, 4.0F, 2.0711F, 5.0F, new CubeDeformation(0.0F))
105+
.texOffs(0, 60).addBox(-2.0F, -2.5F, -1.0355F, 4.0F, 5.0F, 2.0711F, new CubeDeformation(0.0F)), PartPose.offset(9.0F, 0.0F, 0.0F));
96106

97-
PartDefinition octagon_r2 = wheel2.addOrReplaceChild("octagon_r2", CubeListBuilder.create().texOffs(61, 13).mirror().addBox(-2.0F, -2.5F, -1.0355F, 4.0F, 5.0F, 2.0711F, new CubeDeformation(0.0F)).mirror(false)
98-
.texOffs(38, 45).mirror().addBox(-2.0F, -1.0355F, -2.5F, 4.0F, 2.0711F, 5.0F, new CubeDeformation(0.0F)).mirror(false), PartPose.offsetAndRotation(0.0F, 0.0F, 0.0F, -0.7854F, 0.0F, 0.0F));
107+
PartDefinition octagon_r2 = wheel2.addOrReplaceChild("octagon_r2", CubeListBuilder.create().texOffs(0, 60).addBox(-2.0F, -2.5F, -1.0355F, 4.0F, 5.0F, 2.0711F, new CubeDeformation(0.0F))
108+
.texOffs(0, 67).addBox(-2.0F, -1.0355F, -2.5F, 4.0F, 2.0711F, 5.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(0.0F, 0.0F, 0.0F, -0.7854F, 0.0F, 0.0F));
99109

100110
PartDefinition rear_wheels = kart.addOrReplaceChild("rear_wheels", CubeListBuilder.create(), PartPose.offset(0.0F, -2.5F, 9.0F));
101111

102-
PartDefinition cube_r11 = rear_wheels.addOrReplaceChild("cube_r11", CubeListBuilder.create().texOffs(0, 29).addBox(-11.5F, -1.0F, -1.0F, 23.0F, 2.0F, 2.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(0.0F, 0.0F, 0.0F, -0.7854F, 0.0F, 0.0F));
103-
104-
PartDefinition wheel3 = rear_wheels.addOrReplaceChild("wheel3", CubeListBuilder.create().texOffs(20, 44).mirror().addBox(-2.0F, -1.0355F, -2.5F, 4.0F, 2.0711F, 5.0F, new CubeDeformation(0.0F)).mirror(false)
105-
.texOffs(0, 60).mirror().addBox(-2.0F, -2.5F, -1.0355F, 4.0F, 5.0F, 2.0711F, new CubeDeformation(0.0F)).mirror(false), PartPose.offset(9.0F, 0.0F, 0.0F));
112+
PartDefinition wheel3 = rear_wheels.addOrReplaceChild("wheel3", CubeListBuilder.create().texOffs(0, 67).addBox(-2.0F, -1.0355F, -2.5F, 4.0F, 2.0711F, 5.0F, new CubeDeformation(0.0F))
113+
.texOffs(0, 60).addBox(-2.0F, -2.5F, -1.0355F, 4.0F, 5.0F, 2.0711F, new CubeDeformation(0.0F)), PartPose.offset(9.0F, 0.0F, 0.0F));
106114

107-
PartDefinition octagon_r3 = wheel3.addOrReplaceChild("octagon_r3", CubeListBuilder.create().texOffs(61, 13).mirror().addBox(-2.0F, -2.5F, -1.0355F, 4.0F, 5.0F, 2.0711F, new CubeDeformation(0.0F)).mirror(false)
108-
.texOffs(38, 45).mirror().addBox(-2.0F, -1.0355F, -2.5F, 4.0F, 2.0711F, 5.0F, new CubeDeformation(0.0F)).mirror(false), PartPose.offsetAndRotation(0.0F, 0.0F, 0.0F, -0.7854F, 0.0F, 0.0F));
115+
PartDefinition octagon_r3 = wheel3.addOrReplaceChild("octagon_r3", CubeListBuilder.create().texOffs(0, 60).addBox(-2.0F, -2.5F, -1.0355F, 4.0F, 5.0F, 2.0711F, new CubeDeformation(0.0F))
116+
.texOffs(0, 67).addBox(-2.0F, -1.0355F, -2.5F, 4.0F, 2.0711F, 5.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(0.0F, 0.0F, 0.0F, -0.7854F, 0.0F, 0.0F));
109117

110-
PartDefinition wheel4 = rear_wheels.addOrReplaceChild("wheel4", CubeListBuilder.create().texOffs(20, 44).addBox(-2.0F, -1.0355F, -2.5F, 4.0F, 2.0711F, 5.0F, new CubeDeformation(0.0F))
118+
PartDefinition wheel4 = rear_wheels.addOrReplaceChild("wheel4", CubeListBuilder.create().texOffs(0, 67).addBox(-2.0F, -1.0355F, -2.5F, 4.0F, 2.0711F, 5.0F, new CubeDeformation(0.0F))
111119
.texOffs(0, 60).addBox(-2.0F, -2.5F, -1.0355F, 4.0F, 5.0F, 2.0711F, new CubeDeformation(0.0F)), PartPose.offset(-9.0F, 0.0F, 0.0F));
112120

113-
PartDefinition octagon_r4 = wheel4.addOrReplaceChild("octagon_r4", CubeListBuilder.create().texOffs(61, 13).addBox(-2.0F, -2.5F, -1.0355F, 4.0F, 5.0F, 2.0711F, new CubeDeformation(0.0F))
114-
.texOffs(38, 45).addBox(-2.0F, -1.0355F, -2.5F, 4.0F, 2.0711F, 5.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(0.0F, 0.0F, 0.0F, -0.7854F, 0.0F, 0.0F));
121+
PartDefinition octagon_r4 = wheel4.addOrReplaceChild("octagon_r4", CubeListBuilder.create().texOffs(0, 60).addBox(-2.0F, -2.5F, -1.0355F, 4.0F, 5.0F, 2.0711F, new CubeDeformation(0.0F))
122+
.texOffs(0, 67).addBox(-2.0F, -1.0355F, -2.5F, 4.0F, 2.0711F, 5.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(0.0F, 0.0F, 0.0F, -0.7854F, 0.0F, 0.0F));
123+
124+
PartDefinition axis = kart.addOrReplaceChild("axis", CubeListBuilder.create(), PartPose.offset(0.0F, 0.0F, 0.0F));
125+
126+
PartDefinition cube_r10 = axis.addOrReplaceChild("cube_r10", CubeListBuilder.create().texOffs(0, 29).addBox(-11.5F, -1.0F, -1.0F, 23.0F, 2.0F, 2.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(0.0F, -2.5F, 9.0F, -0.7854F, 0.0F, 0.0F));
127+
128+
PartDefinition cube_r11 = axis.addOrReplaceChild("cube_r11", CubeListBuilder.create().texOffs(0, 29).addBox(-11.5F, -1.0F, -1.0F, 23.0F, 2.0F, 2.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(0.0F, -2.5F, -8.0F, -0.7854F, 0.0F, 0.0F));
129+
130+
PartDefinition player = partdefinition.addOrReplaceChild("player", CubeListBuilder.create().texOffs(63, 63).addBox(-4.0F, -20.0F, -4.0F, 8.0F, 8.0F, 8.0F, new CubeDeformation(0.0F))
131+
.texOffs(95, 63).addBox(-4.0F, -20.0F, -4.0F, 8.0F, 8.0F, 8.0F, new CubeDeformation(0.5F))
132+
.texOffs(79, 79).addBox(-4.0F, -12.0F, -2.0F, 8.0F, 12.0F, 4.0F, new CubeDeformation(0.0F))
133+
.texOffs(79, 95).addBox(-4.0F, -12.0F, -2.0F, 8.0F, 12.0F, 4.0F, new CubeDeformation(0.25F)), PartPose.offset(0.0F, 17.0F, 6.0F));
134+
135+
PartDefinition left_pants_r1 = player.addOrReplaceChild("left_pants_r1", CubeListBuilder.create().texOffs(63, 111).addBox(0.0F, 0.0F, -2.0F, 4.0F, 12.0F, 4.0F, new CubeDeformation(0.25F))
136+
.texOffs(79, 111).addBox(0.0F, 0.0F, -2.0F, 4.0F, 12.0F, 4.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(0.0F, 0.0F, 0.0F, -1.5708F, -0.3927F, 0.0F));
137+
138+
PartDefinition right_pants_r1 = player.addOrReplaceChild("right_pants_r1", CubeListBuilder.create().texOffs(63, 95).addBox(-4.0F, 0.0F, -2.0F, 4.0F, 12.0F, 4.0F, new CubeDeformation(0.25F))
139+
.texOffs(63, 79).addBox(-4.0F, 0.0F, -2.0F, 4.0F, 12.0F, 4.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(0.0F, 0.0F, 0.0F, -1.5708F, 0.3927F, 0.0F));
140+
141+
PartDefinition right_sleeve_r1 = player.addOrReplaceChild("right_sleeve_r1", CubeListBuilder.create().texOffs(103, 95).addBox(-8.0F, -2.0F, -2.0F, 4.0F, 12.0F, 4.0F, new CubeDeformation(0.25F))
142+
.texOffs(103, 79).addBox(-8.0F, -2.0F, -2.0F, 4.0F, 12.0F, 4.0F, new CubeDeformation(0.0F))
143+
.texOffs(111, 111).addBox(4.0F, -2.0F, -2.0F, 4.0F, 12.0F, 4.0F, new CubeDeformation(0.25F))
144+
.texOffs(95, 111).addBox(4.0F, -2.0F, -2.0F, 4.0F, 12.0F, 4.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(0.0F, -10.0F, 0.0F, -1.1781F, 0.0F, 0.0F));
115145

116146
return LayerDefinition.create(meshdefinition, 128, 128);
117147
}
@@ -130,7 +160,7 @@ public void renderToBuffer(@NotNull PoseStack poseStack, @NotNull VertexConsumer
130160

131161
public void updateAnimate(@NotNull MartingCarEntity entity, float partialTicks) {
132162
var steeringRad = entity.getSteeringRotateRadian();
133-
steering_inner.yRot = Mth.rotLerp(partialTicks, prevSteeringRad, steeringRad);
163+
inner.yRot = Mth.rotLerp(partialTicks, prevSteeringRad, steeringRad);
134164
// Fixme: rotation vector to euler angles, needs some linear algebra staff.
135165
// wheel.yRot = Mth.rotLerp(partialTicks, prevSteeringRad, steeringRad);
136166
// wheel2.yRot = Mth.rotLerp(partialTicks, prevSteeringRad, steeringRad);
@@ -139,7 +169,7 @@ public void updateAnimate(@NotNull MartingCarEntity entity, float partialTicks)
139169
front_wheels.xRot = Mth.rotLerp(partialTicks, prevWheelsRad, wheelRad);
140170
rear_wheels.xRot = Mth.rotLerp(partialTicks, prevWheelsRad, wheelRad);
141171

142-
prevSteeringRad = steering_inner.yRot;
172+
prevSteeringRad = inner.yRot;
143173
prevWheelsRad = rear_wheels.xRot;
144174
}
145175
}

src/main/java/org/teacon/powertool/entity/MartingCarEntity.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -511,7 +511,7 @@ public enum Variant {
511511
this.name = name;
512512
this.itemSupplier = itemSupplier;
513513
this.id = ResourceLocation.fromNamespaceAndPath(PowerTool.MODID, name);
514-
this.texture = ResourceLocation.fromNamespaceAndPath(PowerTool.MODID, "textures/item/" + name + ".png");
514+
this.texture = ResourceLocation.fromNamespaceAndPath(PowerTool.MODID, "textures/entity/" + name + ".png");
515515
}
516516

517517
public static Variant from(String name) {
Loading
Loading
Loading

0 commit comments

Comments
 (0)