Updated Armor Models

This commit is contained in:
Frank Bauer 2021-06-24 17:32:02 +02:00
parent 10a9a81725
commit 371d491e5f
4 changed files with 102 additions and 47 deletions

View file

@ -6,6 +6,8 @@ import com.google.common.collect.Lists;
import net.minecraft.client.model.HumanoidModel;
import net.minecraft.client.model.geom.ModelPart;
import net.minecraft.client.model.geom.PartPose;
import net.minecraft.client.model.geom.builders.*;
import net.minecraft.client.renderer.RenderType;
import net.minecraft.world.entity.LivingEntity;
@ -13,15 +15,31 @@ public class CrystaliteBootsModel extends HumanoidModel<LivingEntity> {
public ModelPart leftBoot;
public ModelPart rightBoot;
public static LayerDefinition getTexturedModelData() {
final float scale = 1.0f;
MeshDefinition modelData = new MeshDefinition();
PartDefinition modelPartData = modelData.getRoot();
CubeDeformation deformation = new CubeDeformation(scale + 0.25f);
modelPartData.addOrReplaceChild("leftBoot", CubeListBuilder.create()
.addBox(-2.0f, 0.0f, -2.0f, 4.0f, 12.0f, 4.0f, deformation)
.texOffs(0, 32),
PartPose.offset(1.9f, 12.0f, 0.0f));
modelPartData.addOrReplaceChild("rightBoot", CubeListBuilder.create()
.addBox(-2.0f, 0.0f, -2.0f, 4.0f, 12.0f, 4.0f, deformation)
.texOffs(0, 16),
PartPose.offset(-1.9f, 12.0f, 0.0f));
return LayerDefinition.create(modelData, 64, 48);
}
public CrystaliteBootsModel(float scale) {
super(RenderType::entityTranslucent, scale, 0.0F, 64, 48);
this.leftBoot = new ModelPart(this, 0, 32);
this.leftBoot.addBox(-2.0F, 0.0F, -2.0F, 4.0F, 12.0F, 4.0F, scale + 0.25F);
this.leftBoot.setPos(1.9F, 12.0F, 0.0F);
this.rightBoot = new ModelPart(this, 0, 16);
this.rightBoot.addBox(-2.0F, 0.0F, -2.0F, 4.0F, 12.0F, 4.0F, scale + 0.25F);
this.rightBoot.setPos(-1.9F, 12.0F, 0.0F);
public CrystaliteBootsModel(ModelPart modelPart) {
super(modelPart, RenderType::entityTranslucent);
leftBoot = modelPart.getChild("leftBoot");
rightBoot = modelPart.getChild("rightBoot");
}
@Override

View file

@ -8,17 +8,31 @@ import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.minecraft.client.model.HumanoidModel;
import net.minecraft.client.model.geom.ModelPart;
import net.minecraft.client.model.geom.PartNames;
import net.minecraft.client.model.geom.PartPose;
import net.minecraft.client.model.geom.builders.*;
import net.minecraft.client.renderer.RenderType;
import net.minecraft.world.entity.LivingEntity;
@Environment(EnvType.CLIENT)
public class CrystaliteHelmetModel extends HumanoidModel<LivingEntity> {
final ModelPart myHat;
public static LayerDefinition getTexturedModelData() {
final float scale = 1.0f;
MeshDefinition modelData = new MeshDefinition();
PartDefinition modelPartData = modelData.getRoot();
CubeDeformation deformation_hat = new CubeDeformation(scale + 0.5f);
PartDefinition hat = modelPartData.addOrReplaceChild(PartNames.HAT, CubeListBuilder.create()
.addBox(-4.0f, -8.0f, -4.0f, 8.0f, 8.0f, 8.0f, deformation_hat)
.texOffs(0, 0),
PartPose.ZERO);
public CrystaliteHelmetModel(float scale) {
super(RenderType::entityTranslucent, scale, 0.0F, 64, 48);
this.hat = new ModelPart(this, 0, 0);
this.hat.addBox(-4.0F, -8.0F, -4.0F, 8.0F, 8.0F, 8.0F, scale + 0.5F);
this.hat.setPos(0.0F, 0.0F, 0.0F);
return LayerDefinition.create(modelData, 64, 48);
}
public CrystaliteHelmetModel(ModelPart modelPart) {
super(modelPart, RenderType::entityTranslucent);
myHat = modelPart.getChild(PartNames.HAT);
}
@Override
@ -28,6 +42,6 @@ public class CrystaliteHelmetModel extends HumanoidModel<LivingEntity> {
@Override
protected Iterable<ModelPart> bodyParts() {
return Lists.newArrayList(hat);
return Lists.newArrayList(myHat);
}
}

View file

@ -6,22 +6,46 @@ import com.google.common.collect.Lists;
import net.minecraft.client.model.HumanoidModel;
import net.minecraft.client.model.geom.ModelPart;
import net.minecraft.client.model.geom.PartNames;
import net.minecraft.client.model.geom.PartPose;
import net.minecraft.client.model.geom.builders.*;
import net.minecraft.client.renderer.RenderType;
import net.minecraft.world.entity.LivingEntity;
public class CrystaliteLeggingsModel extends HumanoidModel<LivingEntity> {
public static LayerDefinition getTexturedModelData() {
float scale = 1.0f;
MeshDefinition modelData = new MeshDefinition();
PartDefinition modelPartData = modelData.getRoot();
CubeDeformation deformation = new CubeDeformation(scale);
modelPartData.addOrReplaceChild(PartNames.BODY, CubeListBuilder.create()
.addBox(-4.0f, 0.0f, -2.0f, 8.0f, 12.0f, 4.0f, deformation)
.texOffs(16, 16),
PartPose.ZERO);
public CrystaliteLeggingsModel(float scale) {
super(RenderType::entityTranslucent, scale, 0.0F, 64, 48);
this.body = new ModelPart(this, 16, 16);
this.body.addBox(-4.0F, 0.0F, -2.0F, 8.0F, 12.0F, 4.0F, scale);
this.body.setPos(0.0F, 0.0F, 0.0F);
this.leftLeg = new ModelPart(this, 0, 32);
this.leftLeg.addBox(-2.0F, 0.0F, -2.0F, 4.0F, 12.0F, 4.0F, scale);
this.leftLeg.setPos(1.9F, 12.0F, 0.0F);
this.rightLeg = new ModelPart(this, 0, 16);
this.rightLeg.addBox(-2.0F, 0.0F, -2.0F, 4.0F, 12.0F, 4.0F, scale);
this.rightLeg.setPos(-1.9F, 12.0F, 0.0F);
modelPartData.addOrReplaceChild(PartNames.LEFT_LEG, CubeListBuilder.create()
.addBox(-2.0f, 0.0f, -2.0f, 4.0f, 12.0f, 4.0f, deformation)
.texOffs(0, 32),
PartPose.offset(1.9f, 12.0f, 0.0f));
modelPartData.addOrReplaceChild(PartNames.RIGHT_LEG, CubeListBuilder.create()
.addBox(-2.0f, 0.0f, -2.0f, 4.0f, 12.0f, 4.0f, deformation)
.texOffs(0, 16),
PartPose.offset(-1.9f, 12.0f, 0.0f));
return LayerDefinition.create(modelData, 64, 48);
}
final ModelPart myBody;
final ModelPart myLeftLeg;
final ModelPart myRightLeg;
public CrystaliteLeggingsModel(ModelPart modelPart) {
super(modelPart, RenderType::entityTranslucent);
myBody = modelPart.getChild(PartNames.BODY);
myLeftLeg = modelPart.getChild(PartNames.LEFT_LEG);
myRightLeg = modelPart.getChild(PartNames.RIGHT_LEG);
}
@Override
@ -31,6 +55,6 @@ public class CrystaliteLeggingsModel extends HumanoidModel<LivingEntity> {
@Override
protected Iterable<ModelPart> bodyParts() {
return Lists.newArrayList(body, rightLeg, leftLeg);
return Lists.newArrayList(myBody, myRightLeg, myLeftLeg);
}
}