mirror of
https://github.com/MineLittlePony/MineLittlePony.git
synced 2025-02-18 02:24:22 +01:00
I'm only learning, bear with me! Also shifting wing positions and textures to accomodate for bags.
This commit is contained in:
parent
d09a27553e
commit
fcaf1eb569
3 changed files with 18 additions and 24 deletions
|
@ -18,8 +18,10 @@ public class PegasusWings implements IModelPart {
|
|||
public <T extends AbstractPonyModel & IModelPegasus> PegasusWings(T model, float yOffset, float stretch) {
|
||||
pegasus = model;
|
||||
|
||||
leftWing = new ModelWing(model, false, 4f, yOffset, stretch, 32);
|
||||
rightWing = new ModelWing(model, true, -6f, yOffset, stretch, 16);
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
|
@ -67,8 +69,11 @@ public class PegasusWings implements IModelPart {
|
|||
|
||||
@Override
|
||||
public void render(float scale) {
|
||||
boolean standing = pegasus.wingsAreOpen();
|
||||
leftWing.render(standing, scale);
|
||||
rightWing.render(standing, scale);
|
||||
AbstractPonyModel model = ((AbstractPonyModel) pegasus);
|
||||
if (!model.metadata.hasBags() || model.textureHeight == 64) {
|
||||
boolean standing = pegasus.wingsAreOpen();
|
||||
leftWing.render(standing, scale);
|
||||
rightWing.render(standing, scale);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -14,17 +14,11 @@ public class PonyAccessory implements IModelPart {
|
|||
|
||||
public PlaneRenderer bag;
|
||||
|
||||
public <T extends AbstractPonyModel> PonyAccessory(T model) {
|
||||
public <T extends AbstractPonyModel> PonyAccessory(T model, float yOffset, float stretch) {
|
||||
theModel = model;
|
||||
|
||||
if (theModel.metadata.hasBags()) {
|
||||
bag = new PlaneRenderer(theModel, 56, 19);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(float yOffset, float stretch) {
|
||||
if (bag != null && theModel.metadata.hasBags()) {
|
||||
bag.offset(BODY_CENTRE_X, BODY_CENTRE_Y, BODY_CENTRE_Z)
|
||||
.around(HEAD_RP_X, HEAD_RP_Y + yOffset, HEAD_RP_Z)
|
||||
.tex(56, 25).addBackPlane(-7, -5, -4, 3, 6, stretch) //right bag front
|
||||
|
@ -47,7 +41,11 @@ public class PonyAccessory implements IModelPart {
|
|||
}
|
||||
}
|
||||
|
||||
@Override // I really didn't know, what to do here, but since this has to be overridden...
|
||||
@Override
|
||||
public void init(float yOffset, float stretch) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRotationAndAngles(boolean rainboom, float move, float swing, float bodySwing, float ticks) {
|
||||
}
|
||||
|
||||
|
|
|
@ -21,9 +21,8 @@ public class ModelEarthPony extends AbstractPonyModel {
|
|||
@Override
|
||||
public void init(float yOffset, float stretch) {
|
||||
super.init(yOffset, stretch);
|
||||
|
||||
if (accessory != null && metadata.hasAccessory()) {
|
||||
accessory.init(yOffset, stretch);
|
||||
if (metadata.hasAccessory()) {
|
||||
accessory = new PonyAccessory(this, yOffset, stretch);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -43,14 +42,6 @@ public class ModelEarthPony extends AbstractPonyModel {
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initTextures() {
|
||||
super.initTextures();
|
||||
if (metadata.hasAccessory()) {
|
||||
accessory = new PonyAccessory(this);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRotationAngles(float move, float swing, float ticks, float headYaw, float headPitch, float scale, Entity entity) {
|
||||
super.setRotationAngles(move, swing, ticks, headYaw, headPitch, scale, entity);
|
||||
|
|
Loading…
Reference in a new issue