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.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;
|
||||
|
||||
folded.offset((hasBags ? (mirror ? -0.5f : 0.5f) : 0f), (hasBags ? -0.5f : 0f), (hasBags ? -1.5f : 0f));
|
||||
if (extend) {
|
||||
extended.render(scale);
|
||||
} else {
|
||||
|
|
|
@ -18,10 +18,8 @@ public class PegasusWings implements IModelPart {
|
|||
public <T extends AbstractPonyModel & IModelPegasus> PegasusWings(T model, float yOffset, float stretch) {
|
||||
pegasus = model;
|
||||
|
||||
boolean hasBags = ((AbstractPonyModel) pegasus).metadata.hasBags();
|
||||
if (hasBags) yOffset -= 12f;
|
||||
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);
|
||||
leftWing = new ModelWing(model, false, 4f, yOffset, stretch, 32);
|
||||
rightWing = new ModelWing(model, true, -6f, yOffset, stretch, 16);
|
||||
}
|
||||
|
||||
|
||||
|
@ -70,10 +68,11 @@ public class PegasusWings implements IModelPart {
|
|||
@Override
|
||||
public void render(float scale) {
|
||||
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();
|
||||
leftWing.render(standing, scale);
|
||||
rightWing.render(standing, scale);
|
||||
leftWing.render(hasBags, 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) {
|
||||
theModel = model;
|
||||
|
||||
if (theModel.metadata.hasBags()) {
|
||||
bag = new PlaneRenderer(theModel, 56, 19);
|
||||
bag.offset(BODY_CENTRE_X, BODY_CENTRE_Y, BODY_CENTRE_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
|
||||
.rotateAngleY = 4.712389F;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(float yOffset, float stretch) {
|
||||
|
|
|
@ -21,10 +21,8 @@ public class ModelEarthPony extends AbstractPonyModel {
|
|||
@Override
|
||||
public void init(float yOffset, float stretch) {
|
||||
super.init(yOffset, stretch);
|
||||
if (metadata.hasAccessory()) {
|
||||
accessory = new PonyAccessory(this, yOffset, stretch);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void shakeBody(float move, float swing, float bodySwing, float ticks) {
|
||||
|
|
|
@ -84,6 +84,7 @@ public class PonyData implements IPonyData {
|
|||
.add("gender", gender)
|
||||
.add("size", size)
|
||||
.add("glowColor", "#" + Integer.toHexString(glowColor))
|
||||
.add("accessory", accessory)
|
||||
.toString();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue