2016-11-17 05:45:04 +01:00
|
|
|
package com.minelittlepony.model.part;
|
2015-12-14 09:29:10 +01:00
|
|
|
|
2016-11-17 05:45:04 +01:00
|
|
|
import com.minelittlepony.PonyData;
|
|
|
|
import com.minelittlepony.PonyGender;
|
|
|
|
import com.minelittlepony.model.AbstractPonyModel;
|
|
|
|
import com.minelittlepony.model.PonyModelConstants;
|
|
|
|
import com.minelittlepony.renderer.PlaneRenderer;
|
2015-12-14 09:29:10 +01:00
|
|
|
|
|
|
|
public class PonySnout extends AbstractHeadPart implements PonyModelConstants {
|
|
|
|
|
2016-11-22 22:19:18 +01:00
|
|
|
private PlaneRenderer mare;
|
|
|
|
private PlaneRenderer stallion;
|
2015-12-14 09:29:10 +01:00
|
|
|
|
2016-04-09 08:24:15 +02:00
|
|
|
public PonySnout(AbstractPonyModel pony) {
|
|
|
|
super(pony);
|
|
|
|
}
|
|
|
|
|
2015-12-14 09:29:10 +01:00
|
|
|
@Override
|
2016-04-09 08:24:15 +02:00
|
|
|
public void init(float yOffset, float stretch) {
|
2015-12-14 09:29:10 +01:00
|
|
|
|
2016-11-22 22:19:18 +01:00
|
|
|
mare = new PlaneRenderer(this.pony);
|
|
|
|
mare.setRotationPoint(HEAD_RP_X, HEAD_RP_Y + yOffset, HEAD_RP_Z);
|
|
|
|
|
|
|
|
mare.setTextureOffset(10, 14).addBackPlane(-2.0F + HEAD_CENTRE_X, 2.0F + HEAD_CENTRE_Y, -5.0F + HEAD_CENTRE_Z, 4, 2, 0, stretch);
|
|
|
|
mare.setTextureOffset(11, 13).addBackPlane(-1.0F + HEAD_CENTRE_X, 1.0F + HEAD_CENTRE_Y, -5.0F + HEAD_CENTRE_Z, 2, 1, 0, stretch);
|
|
|
|
mare.setTextureOffset(9, 14).addTopPlane(-2.0F + HEAD_CENTRE_X, 2.0F + HEAD_CENTRE_Y, -5.0F + HEAD_CENTRE_Z, 1, 0, 1, stretch);
|
|
|
|
mare.setTextureOffset(14, 14).addTopPlane(1.0F + HEAD_CENTRE_X, 2.0F + HEAD_CENTRE_Y, -5.0F + HEAD_CENTRE_Z, 1, 0, 1, stretch);
|
|
|
|
mare.setTextureOffset(11, 12).addTopPlane(-1.0F + HEAD_CENTRE_X, 1.0F + HEAD_CENTRE_Y, -5.0F + HEAD_CENTRE_Z, 2, 0, 1, stretch);
|
|
|
|
mare.setTextureOffset(18, 7).addBottomPlane(-2.0F + HEAD_CENTRE_X, 4.0F + HEAD_CENTRE_Y, -5.0F + HEAD_CENTRE_Z, 4, 0, 1, stretch);
|
|
|
|
mare.setTextureOffset(9, 14).addWestPlane(-2.0F + HEAD_CENTRE_X, 2.0F + HEAD_CENTRE_Y, -5.0F + HEAD_CENTRE_Z, 0, 2, 1, stretch);
|
|
|
|
mare.setTextureOffset(14, 14).addEastPlane(2.0F + HEAD_CENTRE_X, 2.0F + HEAD_CENTRE_Y, -5.0F + HEAD_CENTRE_Z, 0, 2, 1, stretch);
|
|
|
|
mare.setTextureOffset(11, 12).addWestPlane(-1.0F + HEAD_CENTRE_X, 1.0F + HEAD_CENTRE_Y, -5.0F + HEAD_CENTRE_Z, 0, 1, 1, stretch);
|
|
|
|
mare.setTextureOffset(12, 12).addEastPlane(1.0F + HEAD_CENTRE_X, 1.0F + HEAD_CENTRE_Y, -5.0F + HEAD_CENTRE_Z, 0, 1, 1, stretch);
|
|
|
|
|
|
|
|
stallion = new PlaneRenderer(this.pony);
|
|
|
|
stallion.setRotationPoint(HEAD_RP_X, HEAD_RP_Y + yOffset, HEAD_RP_Z);
|
|
|
|
|
|
|
|
stallion.setTextureOffset(10, 13).addBackPlane(-2.0F + HEAD_CENTRE_X, 1.0F + HEAD_CENTRE_Y, -5.0F + HEAD_CENTRE_Z, 4, 3, 0, stretch);
|
|
|
|
stallion.setTextureOffset(10, 13).addTopPlane(-2.0F + HEAD_CENTRE_X, 1.0F + HEAD_CENTRE_Y, -5.0F + HEAD_CENTRE_Z, 4, 0, 1, stretch);
|
|
|
|
stallion.setTextureOffset(18, 7).addBottomPlane(-2.0F + HEAD_CENTRE_X, 4.0F + HEAD_CENTRE_Y, -5.0F + HEAD_CENTRE_Z, 4, 0, 1, stretch);
|
|
|
|
stallion.setTextureOffset(10, 13).addWestPlane(-2.0F + HEAD_CENTRE_X, 1.0F + HEAD_CENTRE_Y, -5.0F + HEAD_CENTRE_Z, 0, 3, 1, stretch);
|
|
|
|
stallion.setTextureOffset(13, 13).addEastPlane(2.0F + HEAD_CENTRE_X, 1.0F + HEAD_CENTRE_Y, -5.0F + HEAD_CENTRE_Z, 0, 3, 1, stretch);
|
2015-12-14 09:29:10 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2016-11-22 22:19:18 +01:00
|
|
|
public void animate(PonyData metadata, float move, float swing, float tick, float horz, float vert) {
|
|
|
|
mare.isHidden = metadata.getGender() != PonyGender.MARE;
|
|
|
|
stallion.isHidden = metadata.getGender() != PonyGender.STALLION;
|
2015-12-14 09:29:10 +01:00
|
|
|
}
|
|
|
|
|
2016-11-22 22:19:18 +01:00
|
|
|
// @Override
|
|
|
|
// public void render(PonyData data, float scale) {
|
|
|
|
// super.render(data, scale);
|
|
|
|
// if (MineLittlePony.getConfig().snuzzles && data.getGender() != null) {
|
|
|
|
// PlaneRenderer[] muzzle = MUZZLES.get(data.getGender());
|
|
|
|
// for (int i = 0; i < muzzle.length; i++) {
|
|
|
|
// muzzle[i].render(scale);
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
|
2015-12-14 09:29:10 +01:00
|
|
|
}
|