2019-11-23 22:07:39 +01:00
|
|
|
package com.minelittlepony.client.model;
|
2018-05-26 22:50:30 +02:00
|
|
|
|
2019-11-23 22:59:33 +01:00
|
|
|
import com.minelittlepony.client.model.part.PonyEars;
|
2019-11-23 22:19:13 +01:00
|
|
|
import com.minelittlepony.client.model.part.PonySnout;
|
|
|
|
import com.minelittlepony.client.model.part.UnicornHorn;
|
2019-03-23 20:49:34 +01:00
|
|
|
import com.minelittlepony.client.pony.PonyData;
|
2019-03-23 20:58:50 +01:00
|
|
|
import com.minelittlepony.model.ICapitated;
|
|
|
|
import com.minelittlepony.pony.IPonyData;
|
2019-11-22 18:24:22 +01:00
|
|
|
import net.minecraft.client.model.ModelPart;
|
2019-11-23 22:06:07 +01:00
|
|
|
import net.minecraft.client.render.VertexConsumer;
|
2019-05-27 17:59:15 +02:00
|
|
|
import net.minecraft.client.render.entity.model.SkullOverlayEntityModel;
|
2019-11-23 22:06:07 +01:00
|
|
|
import net.minecraft.client.util.math.MatrixStack;
|
2018-05-26 22:50:30 +02:00
|
|
|
|
2019-11-22 18:24:22 +01:00
|
|
|
public class ModelPonyHead extends SkullOverlayEntityModel implements ICapitated<ModelPart> {
|
2018-05-26 22:50:30 +02:00
|
|
|
|
2018-06-10 21:55:13 +02:00
|
|
|
private PonySnout snout;
|
2018-05-26 22:50:30 +02:00
|
|
|
|
2019-11-23 22:06:07 +01:00
|
|
|
private UnicornHorn horn;
|
2018-05-26 22:50:30 +02:00
|
|
|
|
2019-11-23 22:59:33 +01:00
|
|
|
private PonyEars ears;
|
2018-06-10 21:55:13 +02:00
|
|
|
|
2018-05-26 22:50:30 +02:00
|
|
|
public IPonyData metadata = new PonyData();
|
|
|
|
|
|
|
|
@Override
|
2019-11-22 18:24:22 +01:00
|
|
|
public ModelPart getHead() {
|
2019-06-27 19:28:21 +02:00
|
|
|
return skull;
|
2018-05-26 22:50:30 +02:00
|
|
|
}
|
|
|
|
|
2018-06-21 19:28:22 +02:00
|
|
|
@Override
|
|
|
|
public boolean hasHeadGear() {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2018-05-26 22:50:30 +02:00
|
|
|
@Override
|
2019-11-23 22:06:07 +01:00
|
|
|
public void render(MatrixStack stack, VertexConsumer vertices, int overlayUv, int lightUv, float red, float green, float blue, float alpha) {
|
2018-06-10 21:55:13 +02:00
|
|
|
snout.isHidden = metadata.getRace().isHuman();
|
2019-11-23 22:59:33 +01:00
|
|
|
ears.setVisible(!snout.isHidden);
|
2018-05-26 22:50:30 +02:00
|
|
|
|
|
|
|
snout.setGender(metadata.getGender());
|
|
|
|
|
2019-11-23 22:06:07 +01:00
|
|
|
super.render(stack, vertices, overlayUv, lightUv, red, green, blue, alpha);
|
2018-05-26 22:50:30 +02:00
|
|
|
|
2019-07-24 23:37:22 +02:00
|
|
|
if (metadata.hasHorn()) {
|
2019-11-23 22:06:07 +01:00
|
|
|
getHead().rotate(stack);
|
|
|
|
horn.renderPart(stack, vertices, overlayUv, lightUv, red, green, blue, alpha, null);
|
2018-05-26 22:50:30 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|