添加手雷模型

This commit is contained in:
Atsuihsio 2024-07-29 23:31:21 +08:00
parent 163c63a544
commit 9ce5fab6b9
4 changed files with 421 additions and 0 deletions

View file

@ -0,0 +1,65 @@
package net.mcreator.superbwarfare.client.model.entity;
import com.mojang.blaze3d.vertex.PoseStack;
import com.mojang.blaze3d.vertex.VertexConsumer;
import net.mcreator.superbwarfare.ModUtils;
import net.minecraft.client.model.EntityModel;
import net.minecraft.client.model.geom.ModelLayerLocation;
import net.minecraft.client.model.geom.ModelPart;
import net.minecraft.client.model.geom.PartPose;
import net.minecraft.client.model.geom.builders.*;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.entity.Entity;
public class ModelHandGrenade<T extends Entity> extends EntityModel<T> {
// This layer location should be baked with EntityRendererProvider.Context in the entity renderer and passed into this model's constructor
public static final ModelLayerLocation LAYER_LOCATION = new ModelLayerLocation(new ResourceLocation(ModUtils.MODID, "model_hand_grenade_Converted"), "main");
private final ModelPart group;
public ModelHandGrenade(ModelPart root) {
this.group = root.getChild("group");
}
public static LayerDefinition createBodyLayer() {
MeshDefinition meshdefinition = new MeshDefinition();
PartDefinition partdefinition = meshdefinition.getRoot();
PartDefinition group = partdefinition.addOrReplaceChild("group", CubeListBuilder.create().texOffs(6, 8).addBox(-0.4375F, -1.5976F, -0.5375F, 0.875F, 0.3F, 1.075F, new CubeDeformation(0.0F))
.texOffs(11, 13).addBox(-0.45F, -2.45F, -0.6F, 0.9F, 0.85F, 1.35F, new CubeDeformation(0.0F))
.texOffs(13, 14).addBox(-0.45F, -2.45F, 0.75F, 0.9F, 0.85F, 0.3F, new CubeDeformation(0.0F))
.texOffs(12, 15).addBox(-0.45F, -1.95F, 1.05F, 0.9F, 0.35F, 0.3F, new CubeDeformation(0.0F))
.texOffs(11, 14).addBox(-0.45F, -2.25F, 1.05F, 0.9F, 0.3F, 0.2F, new CubeDeformation(0.0F))
.texOffs(9, 13).addBox(-0.5F, -2.65F, -1.1F, 1.0F, 0.2F, 2.2F, new CubeDeformation(0.0F)), PartPose.offset(0.0F, 16.0F, 0.0F));
PartDefinition cube_r1 = group.addOrReplaceChild("cube_r1", CubeListBuilder.create().texOffs(11, 14).addBox(-1.5F, -0.2F, 1.5F, 1.0F, 1.0F, 0.2F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(1.0F, -1.8147F, -0.3941F, 0.3927F, 0.0F, 0.0F));
PartDefinition cube_r2 = group.addOrReplaceChild("cube_r2", CubeListBuilder.create().texOffs(12, 14).addBox(-1.45F, -1.3391F, 0.4F, 0.9F, 0.9391F, 0.3508F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(1.0F, -1.0774F, -0.8165F, 0.3927F, 0.0F, 0.0F));
PartDefinition bone2 = group.addOrReplaceChild("bone2", CubeListBuilder.create(), PartPose.offset(0.0F, 0.0078F, -25.7281F));
PartDefinition bone178_r1 = bone2.addOrReplaceChild("bone178_r1", CubeListBuilder.create().texOffs(0, 8).addBox(-1.2976F, -0.5375F, -0.5375F, 2.5953F, 1.075F, 1.075F, new CubeDeformation(0.0F))
.texOffs(10, 0).addBox(-0.5375F, -1.2976F, -0.5375F, 1.075F, 2.5953F, 1.075F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(0.0F, -0.0078F, 25.7281F, 0.0F, 0.0F, 0.7854F));
PartDefinition bone3 = group.addOrReplaceChild("bone3", CubeListBuilder.create().texOffs(0, 10).addBox(-0.5375F, -1.3054F, 25.1906F, 1.075F, 2.5953F, 1.075F, new CubeDeformation(0.0F)), PartPose.offset(0.0F, 0.0078F, -25.7281F));
PartDefinition bone179_r1 = bone3.addOrReplaceChild("bone179_r1", CubeListBuilder.create().texOffs(5, 1).addBox(-0.5375F, -0.5375F, -1.2976F, 1.075F, 1.075F, 2.5953F, new CubeDeformation(0.0F))
.texOffs(7, 9).addBox(-0.5375F, -1.2976F, -0.5375F, 1.075F, 2.5953F, 1.075F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(0.0F, -0.0078F, 25.7281F, 0.7854F, 0.0F, 0.0F));
PartDefinition bone175 = group.addOrReplaceChild("bone175", CubeListBuilder.create().texOffs(7, 7).addBox(-1.2976F, -0.5453F, 25.1906F, 2.5953F, 1.075F, 1.075F, new CubeDeformation(0.0F))
.texOffs(0, 4).addBox(-0.5375F, -0.5453F, 24.4305F, 1.075F, 1.075F, 2.5953F, new CubeDeformation(0.0F)), PartPose.offset(0.0F, 0.0078F, -25.7281F));
PartDefinition bone180_r1 = bone175.addOrReplaceChild("bone180_r1", CubeListBuilder.create().texOffs(0, 0).addBox(-0.5375F, -0.5375F, -1.2976F, 1.075F, 1.075F, 2.5953F, new CubeDeformation(0.0F))
.texOffs(5, 5).addBox(-1.2976F, -0.5375F, -0.5375F, 2.5953F, 1.075F, 1.075F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(0.0F, -0.0078F, 25.7281F, 0.0F, 0.7854F, 0.0F));
return LayerDefinition.create(meshdefinition, 16, 16);
}
@Override
public void setupAnim(T entity, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch) {
}
@Override
public void renderToBuffer(PoseStack poseStack, VertexConsumer vertexConsumer, int packedLight, int packedOverlay, float red, float green, float blue, float alpha) {
group.render(poseStack, vertexConsumer, packedLight, packedOverlay, red, green, blue, alpha);
}
}

View file

@ -0,0 +1,356 @@
{
"credit": "Made with Blockbench",
"textures": {
"1": "superbwarfare:item/handgrenade"
},
"elements": [
{
"name": "bone176",
"from": [7.4625, 6.70236, 7.4625],
"to": [8.5375, 9.29764, 8.5375],
"rotation": {"angle": 45, "axis": "z", "origin": [8, 8, 8]},
"faces": {
"north": {"uv": [0, 0, 1, 2.5], "texture": "#1"},
"south": {"uv": [1, 0, 2, 2.5], "texture": "#1"},
"up": {"uv": [9, 3, 8, 2], "texture": "#1"},
"down": {"uv": [4, 8, 3, 9], "texture": "#1"}
}
},
{
"name": "bone178",
"from": [6.70236, 7.4625, 7.4625],
"to": [9.29764, 8.5375, 8.5375],
"rotation": {"angle": 45, "axis": "z", "origin": [8, 8, 8]},
"faces": {
"north": {"uv": [2, 0, 4.5, 1], "texture": "#1"},
"east": {"uv": [8, 3, 9, 4], "texture": "#1"},
"south": {"uv": [2, 1, 4.5, 2], "texture": "#1"},
"west": {"uv": [4, 8, 5, 9], "texture": "#1"}
}
},
{
"name": "bone176",
"from": [7.4625, 6.70236, 7.4625],
"to": [8.5375, 9.29764, 8.5375],
"rotation": {"angle": 0, "axis": "z", "origin": [8, 8, 8]},
"faces": {
"east": {"uv": [2, 2, 3, 4.5], "texture": "#1"},
"west": {"uv": [0, 3, 1, 5.5], "texture": "#1"},
"up": {"uv": [6, 9, 5, 8], "texture": "#1"},
"down": {"uv": [9, 6, 8, 7], "texture": "#1"}
}
},
{
"name": "bone177",
"from": [7.4625, 6.70236, 7.4625],
"to": [8.5375, 9.29764, 8.5375],
"rotation": {"angle": -45, "axis": "x", "origin": [8, 8, 8]},
"faces": {
"east": {"uv": [1, 3, 2, 5.5], "texture": "#1"},
"west": {"uv": [3, 2, 4, 4.5], "texture": "#1"},
"up": {"uv": [8, 9, 7, 8], "texture": "#1"},
"down": {"uv": [9, 7, 8, 8], "texture": "#1"}
}
},
{
"name": "bone179",
"from": [7.4625, 7.4625, 6.70236],
"to": [8.5375, 8.5375, 9.29764],
"rotation": {"angle": -45, "axis": "x", "origin": [8, 8, 8]},
"faces": {
"north": {"uv": [8, 8, 9, 9], "texture": "#1"},
"east": {"uv": [4, 2, 6.5, 3], "texture": "#1"},
"south": {"uv": [0, 9, 1, 10], "texture": "#1"},
"west": {"uv": [4, 3, 6.5, 4], "texture": "#1"}
}
},
{
"name": "bone177",
"from": [6.70236, 7.4625, 7.4625],
"to": [9.29764, 8.5375, 8.5375],
"rotation": {"angle": 0, "axis": "z", "origin": [8, 8, 8]},
"faces": {
"east": {"uv": [9, 0, 10, 1], "texture": "#1"},
"west": {"uv": [1, 9, 2, 10], "texture": "#1"},
"up": {"uv": [6.5, 5, 4, 4], "texture": "#1"},
"down": {"uv": [7.5, 0, 5, 1], "texture": "#1"}
}
},
{
"name": "bone178",
"from": [6.70236, 7.4625, 7.4625],
"to": [9.29764, 8.5375, 8.5375],
"rotation": {"angle": -45, "axis": "y", "origin": [8, 8, 8]},
"faces": {
"east": {"uv": [9, 1, 10, 2], "texture": "#1"},
"west": {"uv": [2, 9, 3, 10], "texture": "#1"},
"up": {"uv": [7.5, 2, 5, 1], "texture": "#1"},
"down": {"uv": [4.5, 5, 2, 6], "texture": "#1"}
}
},
{
"name": "bone179",
"from": [7.4625, 7.4625, 6.70236],
"to": [8.5375, 8.5375, 9.29764],
"rotation": {"angle": 0, "axis": "z", "origin": [8, 8, 8]},
"faces": {
"north": {"uv": [9, 2, 10, 3], "texture": "#1"},
"south": {"uv": [3, 9, 4, 10], "texture": "#1"},
"up": {"uv": [6, 7.5, 5, 5], "texture": "#1"},
"down": {"uv": [1, 6, 0, 8.5], "texture": "#1"}
}
},
{
"name": "bone180",
"from": [7.4625, 7.4625, 6.70236],
"to": [8.5375, 8.5375, 9.29764],
"rotation": {"angle": -45, "axis": "y", "origin": [8, 8, 8]},
"faces": {
"north": {"uv": [9, 3, 10, 4], "texture": "#1"},
"south": {"uv": [4, 9, 5, 10], "texture": "#1"},
"up": {"uv": [2, 8.5, 1, 6], "texture": "#1"},
"down": {"uv": [3, 6, 2, 8.5], "texture": "#1"}
}
},
{
"name": "bone177",
"from": [7.5625, 9.29764, 7.4625],
"to": [8.4375, 9.59764, 8.5375],
"rotation": {"angle": 0, "axis": "z", "origin": [8, 8, 8]},
"faces": {
"north": {"uv": [10, 0, 11, 0.5], "texture": "#1"},
"east": {"uv": [1, 10, 2, 10.5], "texture": "#1"},
"south": {"uv": [10, 1, 11, 1.5], "texture": "#1"},
"west": {"uv": [2, 10, 3, 10.5], "texture": "#1"}
}
},
{
"from": [7.55, 9.6, 7.4],
"to": [8.45, 10.45, 8.75],
"rotation": {"angle": 0, "axis": "y", "origin": [7, 9.2, 7]},
"faces": {
"east": {"uv": [7, 4, 8.5, 5], "texture": "#1"},
"south": {"uv": [9, 4, 10, 5], "texture": "#1"},
"west": {"uv": [7, 5, 8.5, 6], "texture": "#1"},
"down": {"uv": [7, 7, 6, 8.5], "texture": "#1"}
}
},
{
"from": [7.55, 9.6, 8.75],
"to": [8.45, 10.45, 9.05],
"rotation": {"angle": 0, "axis": "y", "origin": [7, 9.2, 7]},
"faces": {
"east": {"uv": [10, 2, 10.5, 3], "texture": "#1"},
"west": {"uv": [3, 10, 3.5, 11], "texture": "#1"},
"down": {"uv": [11, 3, 10, 3.5], "texture": "#1"}
}
},
{
"from": [7.55, 9.6, 9.05],
"to": [8.45, 9.95, 9.35],
"rotation": {"angle": 0, "axis": "y", "origin": [7, 9.2, 7]},
"faces": {
"east": {"uv": [11, 7, 11.5, 7.5], "texture": "#1"},
"south": {"uv": [4, 10, 5, 10.5], "texture": "#1"},
"west": {"uv": [8, 11, 8.5, 11.5], "texture": "#1"},
"down": {"uv": [11, 4, 10, 4.5], "texture": "#1"}
}
},
{
"from": [7.55, 9.95, 9.05],
"to": [8.45, 10.25, 9.25],
"rotation": {"angle": 0, "axis": "y", "origin": [8, 10.1, 9.15]},
"faces": {
"east": {"uv": [11, 8, 11.5, 8.5], "texture": "#1"},
"south": {"uv": [5, 10, 6, 10.5], "texture": "#1"},
"west": {"uv": [9, 11, 9.5, 11.5], "texture": "#1"},
"down": {"uv": [7, 10, 6, 10.5], "texture": "#1"}
}
},
{
"from": [7.55, 9.47737, 7.58352],
"to": [8.45, 10.41644, 7.9343],
"rotation": {"angle": -22.5, "axis": "x", "origin": [7, 9.07737, 7.18352]},
"faces": {
"north": {"uv": [5, 9, 6, 10], "texture": "#1"},
"east": {"uv": [10, 6, 10.5, 7], "texture": "#1"},
"west": {"uv": [7, 10, 7.5, 11], "texture": "#1"},
"up": {"uv": [11, 7.5, 10, 7], "texture": "#1"},
"down": {"uv": [11, 8, 10, 8.5], "texture": "#1"}
}
},
{
"from": [7.5, 10.45, 6.9],
"to": [8.5, 10.65, 9.1],
"rotation": {"angle": 0, "axis": "y", "origin": [7, 8.95, 7]},
"faces": {
"north": {"uv": [9, 10, 10, 10.5], "texture": "#1"},
"east": {"uv": [9, 5, 11, 5.5], "texture": "#1"},
"west": {"uv": [6, 9, 8, 9.5], "texture": "#1"},
"up": {"uv": [4, 8, 3, 6], "texture": "#1"},
"down": {"uv": [5, 6, 4, 8], "texture": "#1"}
}
},
{
"from": [7.4, 10.32266, 8.87031],
"to": [8.6, 10.42266, 8.97031],
"rotation": {"angle": 0, "axis": "y", "origin": [8, 10.37266, 8.92031]},
"faces": {
"north": {"uv": [10, 9, 11, 9.5], "texture": "#1"},
"east": {"uv": [11, 9, 11.5, 9.5], "texture": "#1"},
"south": {"uv": [10, 10, 11, 10.5], "texture": "#1"},
"west": {"uv": [10, 11, 10.5, 11.5], "texture": "#1"},
"up": {"uv": [12, 0.5, 11, 0], "texture": "#1"},
"down": {"uv": [2, 11, 1, 11.5], "texture": "#1"}
}
},
{
"from": [7.35, 10.32266, 8.57031],
"to": [7.45, 10.42266, 9.27031],
"rotation": {"angle": -22.5, "axis": "z", "origin": [7.4, 10.37266, 8.92031]},
"faces": {
"north": {"uv": [11, 10, 11.5, 10.5], "texture": "#1"},
"east": {"uv": [11, 11, 11.5, 11.5], "texture": "#1"},
"south": {"uv": [0, 12, 0.5, 12.5], "texture": "#1"},
"west": {"uv": [12, 0, 12.5, 0.5], "texture": "#1"},
"up": {"uv": [1.5, 12.5, 1, 12], "texture": "#1"},
"down": {"uv": [12.5, 1, 12, 1.5], "texture": "#1"}
}
},
{
"from": [7.04385, 9.58355, 8.57031],
"to": [7.14385, 9.68355, 9.27031],
"rotation": {"angle": -22.5, "axis": "z", "origin": [7.09385, 9.63355, 8.92031]},
"faces": {
"north": {"uv": [2, 12, 2.5, 12.5], "texture": "#1"},
"east": {"uv": [12, 2, 12.5, 2.5], "texture": "#1"},
"south": {"uv": [3, 12, 3.5, 12.5], "texture": "#1"},
"west": {"uv": [12, 3, 12.5, 3.5], "texture": "#1"},
"up": {"uv": [4.5, 12.5, 4, 12], "texture": "#1"},
"down": {"uv": [12.5, 4, 12, 4.5], "texture": "#1"}
}
},
{
"from": [7.21606, 9.5493, 9.27031],
"to": [7.31606, 10.4493, 9.37031],
"rotation": {"angle": -22.5, "axis": "z", "origin": [7.26606, 10.0493, 9.32031]},
"faces": {
"north": {"uv": [11, 1, 11.5, 2], "texture": "#1"},
"east": {"uv": [2, 11, 2.5, 12], "texture": "#1"},
"south": {"uv": [11, 2, 11.5, 3], "texture": "#1"},
"west": {"uv": [3, 11, 3.5, 12], "texture": "#1"},
"up": {"uv": [5.5, 12.5, 5, 12], "texture": "#1"},
"down": {"uv": [12.5, 5, 12, 5.5], "texture": "#1"}
}
},
{
"from": [7.21606, 9.5493, 8.47031],
"to": [7.31606, 10.4493, 8.57031],
"rotation": {"angle": -22.5, "axis": "z", "origin": [7.26606, 10.0493, 8.52031]},
"faces": {
"north": {"uv": [11, 3, 11.5, 4], "texture": "#1"},
"east": {"uv": [4, 11, 4.5, 12], "texture": "#1"},
"south": {"uv": [11, 4, 11.5, 5], "texture": "#1"},
"west": {"uv": [5, 11, 5.5, 12], "texture": "#1"},
"up": {"uv": [6.5, 12.5, 6, 12], "texture": "#1"},
"down": {"uv": [12.5, 6, 12, 6.5], "texture": "#1"}
}
},
{
"from": [7.5, 8.06466, 9.10594],
"to": [8.5, 10.01466, 9.30594],
"rotation": {"angle": -22.5, "axis": "x", "origin": [7, 9.81466, 7.60594]},
"faces": {
"north": {"uv": [6, 5, 7, 7], "texture": "#1"},
"east": {"uv": [9, 6, 9.5, 8], "texture": "#1"},
"south": {"uv": [7, 2, 8, 4], "texture": "#1"},
"west": {"uv": [8, 9, 8.5, 11], "texture": "#1"},
"up": {"uv": [12, 5.5, 11, 5], "texture": "#1"},
"down": {"uv": [7, 11, 6, 11.5], "texture": "#1"}
}
},
{
"from": [7.5, 7.39843, 9.64623],
"to": [8.5, 8.84843, 9.84623],
"rotation": {"angle": 0, "axis": "x", "origin": [7, 8.64843, 8.14623]},
"faces": {
"north": {"uv": [7, 6, 8, 7.5], "texture": "#1"},
"east": {"uv": [9, 8, 9.5, 9.5], "texture": "#1"},
"south": {"uv": [8, 0, 9, 1.5], "texture": "#1"},
"west": {"uv": [0, 10, 0.5, 11.5], "texture": "#1"},
"up": {"uv": [12, 6.5, 11, 6], "texture": "#1"},
"down": {"uv": [8, 11, 7, 11.5], "texture": "#1"}
}
}
],
"display": {
"firstperson_righthand": {
"rotation": [0, -9, -7.25],
"translation": [-2, 2.25, 3.25],
"scale": [1.5, 1.5, 1]
},
"firstperson_lefthand": {
"rotation": [0, -9, -7.25],
"translation": [-2, 2.25, 3.25],
"scale": [1.5, 1.5, 1]
},
"ground": {
"translation": [0, -2, 0]
},
"gui": {
"rotation": [-162.56, -39.63, 178.66],
"translation": [0.25, -2.25, 0],
"scale": [3, 3, 3]
},
"head": {
"translation": [0, -1.75, -6.75],
"scale": [1.5, 1.5, 1.5]
},
"fixed": {
"rotation": [90, -45, 90],
"translation": [0.75, -0.5, 0],
"scale": [2, 2, 2]
}
},
"groups": [
{
"name": "group",
"origin": [8, 8, 8],
"color": 0,
"children": [
{
"name": "bone175",
"origin": [8, 7.99219, -17.72809],
"color": 2,
"children": [0, 1]
},
{
"name": "bone175",
"origin": [8, 7.99219, -17.72809],
"color": 2,
"children": [2, 3, 4]
},
{
"name": "bone175",
"origin": [8, 7.99219, -17.72809],
"color": 2,
"children": [5, 6, 7, 8]
},
9,
10,
11,
12,
13,
14,
15,
16,
17,
18,
19,
20,
21,
22
]
}
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 276 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 788 B