mirror of
https://github.com/MineLittlePony/MineLittlePony.git
synced 2024-11-29 07:27:59 +01:00
So THAT's how it works...
This commit is contained in:
parent
646e26985a
commit
b6242902f6
5 changed files with 33 additions and 35 deletions
|
@ -51,11 +51,13 @@ public class ModelWing {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void render(boolean extend, float scale) {
|
public void render(boolean hasBags, boolean extend, float scale) {
|
||||||
extended.rotationPointX = (mirror ? -1 : 1) * LEFT_WING_EXT_RP_X;
|
extended.rotationPointX = (mirror ? -1 : 1) * LEFT_WING_EXT_RP_X;
|
||||||
extended.rotationPointY = LEFT_WING_EXT_RP_Y;
|
extended.rotationPointY = LEFT_WING_EXT_RP_Y + (hasBags ? -1f : 0f);
|
||||||
|
extended.rotationPointZ = LEFT_WING_EXT_RP_Z + (hasBags ? 1f : 0f);
|
||||||
extended.rotateAngleY = 3;
|
extended.rotateAngleY = 3;
|
||||||
|
|
||||||
|
folded.offset((hasBags ? (mirror ? -0.5f : 0.5f) : 0f), (hasBags ? -0.5f : 0f), (hasBags ? -1.5f : 0f));
|
||||||
if (extend) {
|
if (extend) {
|
||||||
extended.render(scale);
|
extended.render(scale);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -18,10 +18,8 @@ public class PegasusWings implements IModelPart {
|
||||||
public <T extends AbstractPonyModel & IModelPegasus> PegasusWings(T model, float yOffset, float stretch) {
|
public <T extends AbstractPonyModel & IModelPegasus> PegasusWings(T model, float yOffset, float stretch) {
|
||||||
pegasus = model;
|
pegasus = model;
|
||||||
|
|
||||||
boolean hasBags = ((AbstractPonyModel) pegasus).metadata.hasBags();
|
leftWing = new ModelWing(model, false, 4f, yOffset, stretch, 32);
|
||||||
if (hasBags) yOffset -= 12f;
|
rightWing = new ModelWing(model, true, -6f, yOffset, stretch, 16);
|
||||||
leftWing = new ModelWing(model, false, 4f - (hasBags ? -0.5f : 0f), yOffset, stretch, 32);
|
|
||||||
rightWing = new ModelWing(model, true, (hasBags ? -0.5f : 0f) - 6f, yOffset, stretch, hasBags ? 32 : 16);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -70,10 +68,11 @@ public class PegasusWings implements IModelPart {
|
||||||
@Override
|
@Override
|
||||||
public void render(float scale) {
|
public void render(float scale) {
|
||||||
AbstractPonyModel model = ((AbstractPonyModel) pegasus);
|
AbstractPonyModel model = ((AbstractPonyModel) pegasus);
|
||||||
if (!model.metadata.hasBags() || model.textureHeight == 64) {
|
boolean hasBags = model.metadata.hasBags();
|
||||||
|
if (!hasBags || model.textureHeight == 64) {
|
||||||
boolean standing = pegasus.wingsAreOpen();
|
boolean standing = pegasus.wingsAreOpen();
|
||||||
leftWing.render(standing, scale);
|
leftWing.render(hasBags, standing, scale);
|
||||||
rightWing.render(standing, scale);
|
rightWing.render(hasBags, standing, scale);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,7 +17,6 @@ public class PonyAccessory implements IModelPart {
|
||||||
public <T extends AbstractPonyModel> PonyAccessory(T model, float yOffset, float stretch) {
|
public <T extends AbstractPonyModel> PonyAccessory(T model, float yOffset, float stretch) {
|
||||||
theModel = model;
|
theModel = model;
|
||||||
|
|
||||||
if (theModel.metadata.hasBags()) {
|
|
||||||
bag = new PlaneRenderer(theModel, 56, 19);
|
bag = new PlaneRenderer(theModel, 56, 19);
|
||||||
bag.offset(BODY_CENTRE_X, BODY_CENTRE_Y, BODY_CENTRE_Z)
|
bag.offset(BODY_CENTRE_X, BODY_CENTRE_Y, BODY_CENTRE_Z)
|
||||||
.around(HEAD_RP_X, HEAD_RP_Y + yOffset, HEAD_RP_Z)
|
.around(HEAD_RP_X, HEAD_RP_Y + yOffset, HEAD_RP_Z)
|
||||||
|
@ -39,7 +38,6 @@ public class PonyAccessory implements IModelPart {
|
||||||
.flipZ().addBottomPlane(2, 1, -2, 8, 3, stretch) //right bag bottom
|
.flipZ().addBottomPlane(2, 1, -2, 8, 3, stretch) //right bag bottom
|
||||||
.rotateAngleY = 4.712389F;
|
.rotateAngleY = 4.712389F;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void init(float yOffset, float stretch) {
|
public void init(float yOffset, float stretch) {
|
||||||
|
|
|
@ -21,10 +21,8 @@ public class ModelEarthPony extends AbstractPonyModel {
|
||||||
@Override
|
@Override
|
||||||
public void init(float yOffset, float stretch) {
|
public void init(float yOffset, float stretch) {
|
||||||
super.init(yOffset, stretch);
|
super.init(yOffset, stretch);
|
||||||
if (metadata.hasAccessory()) {
|
|
||||||
accessory = new PonyAccessory(this, yOffset, stretch);
|
accessory = new PonyAccessory(this, yOffset, stretch);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void shakeBody(float move, float swing, float bodySwing, float ticks) {
|
protected void shakeBody(float move, float swing, float bodySwing, float ticks) {
|
||||||
|
|
|
@ -84,6 +84,7 @@ public class PonyData implements IPonyData {
|
||||||
.add("gender", gender)
|
.add("gender", gender)
|
||||||
.add("size", size)
|
.add("size", size)
|
||||||
.add("glowColor", "#" + Integer.toHexString(glowColor))
|
.add("glowColor", "#" + Integer.toHexString(glowColor))
|
||||||
|
.add("accessory", accessory)
|
||||||
.toString();
|
.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue