Updated Armor Models
This commit is contained in:
parent
10a9a81725
commit
371d491e5f
4 changed files with 102 additions and 47 deletions
41
Convert.java
41
Convert.java
|
@ -8,6 +8,7 @@ class ModelPart {
|
||||||
float x=0, y=0, z=0, rx=0, ry=0, rz=0;
|
float x=0, y=0, z=0, rx=0, ry=0, rz=0;
|
||||||
int u=0, v=0;
|
int u=0, v=0;
|
||||||
float bx=0,by=0,bz=0,ba=0,bb=0,bc=0;
|
float bx=0,by=0,bz=0,ba=0,bb=0,bc=0;
|
||||||
|
float scale = 1;
|
||||||
|
|
||||||
|
|
||||||
boolean hadBox = false;
|
boolean hadBox = false;
|
||||||
|
@ -55,6 +56,7 @@ class ModelPart {
|
||||||
ba=a;
|
ba=a;
|
||||||
bb=b;
|
bb=b;
|
||||||
bc=c;
|
bc=c;
|
||||||
|
scale = _d;
|
||||||
hadBox = true;
|
hadBox = true;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
@ -71,11 +73,20 @@ class ModelPart {
|
||||||
}
|
}
|
||||||
|
|
||||||
public String toString(){
|
public String toString(){
|
||||||
|
String s = "";
|
||||||
String pName = parent==null?"modelPartData":parent.name;
|
String pName = parent==null?"modelPartData":parent.name;
|
||||||
String s = "PartDefinition " + name + " = ";
|
if (scale!=1){
|
||||||
|
s += "CubeDeformation deformation_"+name+" = new CubeDeformation("+scale+"f);\n";
|
||||||
|
}
|
||||||
|
s += "PartDefinition " + name + " = ";
|
||||||
s += pName+".addOrReplaceChild(\""+name+"\", CubeListBuilder.create()\n";
|
s += pName+".addOrReplaceChild(\""+name+"\", CubeListBuilder.create()\n";
|
||||||
if (this.mirror) s+= ".mirror()\n";
|
if (this.mirror) s+= ".mirror()\n";
|
||||||
if (this.hadBox) s+= ".addBox("+bx+"f, "+by+"f, "+bz+"f, "+ba+"f, "+bb+"f, "+bc+"f)\n";
|
if (this.hadBox) {
|
||||||
|
if (scale!=1)
|
||||||
|
s+= ".addBox("+bx+"f, "+by+"f, "+bz+"f, "+ba+"f, "+bb+"f, "+bc+"f, deformation_"+name+")\n";
|
||||||
|
else
|
||||||
|
s+= ".addBox("+bx+"f, "+by+"f, "+bz+"f, "+ba+"f, "+bb+"f, "+bc+"f)\n";
|
||||||
|
}
|
||||||
s+= ".texOffs("+u+", "+v+"),\n";
|
s+= ".texOffs("+u+", "+v+"),\n";
|
||||||
if (x==0 && y==0 && z==0 && rx==0 && ry==0 && rz==0){
|
if (x==0 && y==0 && z==0 && rx==0 && ry==0 && rz==0){
|
||||||
s+= "PartPose.ZERO";
|
s+= "PartPose.ZERO";
|
||||||
|
@ -119,27 +130,15 @@ public class Convert {
|
||||||
p.setRotationAngle(x, y, z);
|
p.setRotationAngle(x, y, z);
|
||||||
}
|
}
|
||||||
public void c (){
|
public void c (){
|
||||||
boolean thinArms = true;
|
|
||||||
float scale = 0;
|
float scale = 0;
|
||||||
ModelPart body = new ModelPart(this, 16, 16, "body");
|
ModelPart body = new ModelPart(this, 16, 16, "body");
|
||||||
body.addBox(-4.0F, 0.0F, -2.0F, 8.0F, 12.0F, 4.0F, scale + 0.25F);
|
body.addBox(-4.0F, 0.0F, -2.0F, 8.0F, 12.0F, 4.0F, scale);
|
||||||
body.setPos(0.0F, 0.0F, 0.0F);
|
body.setPos(0.0F, 0.0F, 0.0F);
|
||||||
if (thinArms) {
|
ModelPart leftLeg = new ModelPart(this, 0, 32, "leftLeg");
|
||||||
ModelPart leftShoulder = new ModelPart(this, 41, 32, "leftShoulder");
|
leftLeg.addBox(-2.0F, 0.0F, -2.0F, 4.0F, 12.0F, 4.0F, scale);
|
||||||
leftShoulder.addBox(-1.0F, -2.5F, -2.0F, 3.0F, 12.0F, 4.0F, scale + 0.35F);
|
leftLeg.setPos(1.9F, 12.0F, 0.0F);
|
||||||
leftShoulder.setPos(5.0F, 2.5F, 0.0F);
|
ModelPart rightLeg = new ModelPart(this, 0, 16, "rightLeg");
|
||||||
leftShoulder.mirror = true;
|
rightLeg.addBox(-2.0F, 0.0F, -2.0F, 4.0F, 12.0F, 4.0F, scale);
|
||||||
ModelPart rightShoulder = new ModelPart(this, 41, 16, "rightShoulder");
|
rightLeg.setPos(-1.9F, 12.0F, 0.0F);
|
||||||
rightShoulder.addBox(-2.0F, -2.5F, -2.0F, 3.0F, 12.0F, 4.0F, scale + 0.35F);
|
|
||||||
rightShoulder.setPos(-5.0F, 2.5F, 10.0F);
|
|
||||||
} else {
|
|
||||||
ModelPart leftShoulder = new ModelPart(this, 40, 32, "leftShoulder");
|
|
||||||
leftShoulder.addBox(-1.0F, -2.5F, -2.0F, 4.0F, 12.0F, 4.0F, scale + 0.45F);
|
|
||||||
leftShoulder.setPos(5.0F, 2.0F, 0.0F);
|
|
||||||
leftShoulder.mirror = true;
|
|
||||||
ModelPart rightShoulder = new ModelPart(this, 40, 16, "rightShoulder");
|
|
||||||
rightShoulder.addBox(-3.0F, -2.5F, -2.0F, 4.0F, 12.0F, 4.0F, scale + 0.45F);
|
|
||||||
rightShoulder.setPos(-5.0F, 2.0F, 10.0F);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,6 +6,8 @@ import com.google.common.collect.Lists;
|
||||||
|
|
||||||
import net.minecraft.client.model.HumanoidModel;
|
import net.minecraft.client.model.HumanoidModel;
|
||||||
import net.minecraft.client.model.geom.ModelPart;
|
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.client.renderer.RenderType;
|
||||||
import net.minecraft.world.entity.LivingEntity;
|
import net.minecraft.world.entity.LivingEntity;
|
||||||
|
|
||||||
|
@ -13,15 +15,31 @@ public class CrystaliteBootsModel extends HumanoidModel<LivingEntity> {
|
||||||
|
|
||||||
public ModelPart leftBoot;
|
public ModelPart leftBoot;
|
||||||
public ModelPart rightBoot;
|
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) {
|
public CrystaliteBootsModel(ModelPart modelPart) {
|
||||||
super(RenderType::entityTranslucent, scale, 0.0F, 64, 48);
|
super(modelPart, RenderType::entityTranslucent);
|
||||||
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);
|
leftBoot = modelPart.getChild("leftBoot");
|
||||||
this.leftBoot.setPos(1.9F, 12.0F, 0.0F);
|
rightBoot = modelPart.getChild("rightBoot");
|
||||||
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);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -8,17 +8,31 @@ import net.fabricmc.api.EnvType;
|
||||||
import net.fabricmc.api.Environment;
|
import net.fabricmc.api.Environment;
|
||||||
import net.minecraft.client.model.HumanoidModel;
|
import net.minecraft.client.model.HumanoidModel;
|
||||||
import net.minecraft.client.model.geom.ModelPart;
|
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.client.renderer.RenderType;
|
||||||
import net.minecraft.world.entity.LivingEntity;
|
import net.minecraft.world.entity.LivingEntity;
|
||||||
|
|
||||||
@Environment(EnvType.CLIENT)
|
@Environment(EnvType.CLIENT)
|
||||||
public class CrystaliteHelmetModel extends HumanoidModel<LivingEntity> {
|
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) {
|
return LayerDefinition.create(modelData, 64, 48);
|
||||||
super(RenderType::entityTranslucent, scale, 0.0F, 64, 48);
|
}
|
||||||
this.hat = new ModelPart(this, 0, 0);
|
public CrystaliteHelmetModel(ModelPart modelPart) {
|
||||||
this.hat.addBox(-4.0F, -8.0F, -4.0F, 8.0F, 8.0F, 8.0F, scale + 0.5F);
|
super(modelPart, RenderType::entityTranslucent);
|
||||||
this.hat.setPos(0.0F, 0.0F, 0.0F);
|
|
||||||
|
myHat = modelPart.getChild(PartNames.HAT);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -28,6 +42,6 @@ public class CrystaliteHelmetModel extends HumanoidModel<LivingEntity> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Iterable<ModelPart> bodyParts() {
|
protected Iterable<ModelPart> bodyParts() {
|
||||||
return Lists.newArrayList(hat);
|
return Lists.newArrayList(myHat);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,22 +6,46 @@ import com.google.common.collect.Lists;
|
||||||
|
|
||||||
import net.minecraft.client.model.HumanoidModel;
|
import net.minecraft.client.model.HumanoidModel;
|
||||||
import net.minecraft.client.model.geom.ModelPart;
|
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.client.renderer.RenderType;
|
||||||
import net.minecraft.world.entity.LivingEntity;
|
import net.minecraft.world.entity.LivingEntity;
|
||||||
|
|
||||||
public class CrystaliteLeggingsModel extends HumanoidModel<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) {
|
modelPartData.addOrReplaceChild(PartNames.LEFT_LEG, CubeListBuilder.create()
|
||||||
super(RenderType::entityTranslucent, scale, 0.0F, 64, 48);
|
.addBox(-2.0f, 0.0f, -2.0f, 4.0f, 12.0f, 4.0f, deformation)
|
||||||
this.body = new ModelPart(this, 16, 16);
|
.texOffs(0, 32),
|
||||||
this.body.addBox(-4.0F, 0.0F, -2.0F, 8.0F, 12.0F, 4.0F, scale);
|
PartPose.offset(1.9f, 12.0f, 0.0f));
|
||||||
this.body.setPos(0.0F, 0.0F, 0.0F);
|
|
||||||
this.leftLeg = new ModelPart(this, 0, 32);
|
modelPartData.addOrReplaceChild(PartNames.RIGHT_LEG, CubeListBuilder.create()
|
||||||
this.leftLeg.addBox(-2.0F, 0.0F, -2.0F, 4.0F, 12.0F, 4.0F, scale);
|
.addBox(-2.0f, 0.0f, -2.0f, 4.0f, 12.0f, 4.0f, deformation)
|
||||||
this.leftLeg.setPos(1.9F, 12.0F, 0.0F);
|
.texOffs(0, 16),
|
||||||
this.rightLeg = new ModelPart(this, 0, 16);
|
PartPose.offset(-1.9f, 12.0f, 0.0f));
|
||||||
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);
|
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
|
@Override
|
||||||
|
@ -31,6 +55,6 @@ public class CrystaliteLeggingsModel extends HumanoidModel<LivingEntity> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Iterable<ModelPart> bodyParts() {
|
protected Iterable<ModelPart> bodyParts() {
|
||||||
return Lists.newArrayList(body, rightLeg, leftLeg);
|
return Lists.newArrayList(myBody, myRightLeg, myLeftLeg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue