2018-05-26 22:50:30 +02:00
|
|
|
package com.minelittlepony.model.components;
|
|
|
|
|
|
|
|
import com.minelittlepony.model.capabilities.ICapitated;
|
|
|
|
import com.minelittlepony.pony.data.IPonyData;
|
|
|
|
import com.minelittlepony.pony.data.PonyData;
|
2018-09-05 10:12:38 +02:00
|
|
|
import com.minelittlepony.render.model.PonyRenderer;
|
2018-05-26 22:50:30 +02:00
|
|
|
|
|
|
|
import net.minecraft.client.model.ModelHumanoidHead;
|
|
|
|
import net.minecraft.client.model.ModelRenderer;
|
|
|
|
import net.minecraft.entity.Entity;
|
|
|
|
|
|
|
|
public class ModelPonyHead extends ModelHumanoidHead implements ICapitated {
|
|
|
|
|
2018-06-10 21:55:13 +02:00
|
|
|
private PonySnout snout;
|
2018-05-26 22:50:30 +02:00
|
|
|
|
|
|
|
private final UnicornHorn horn;
|
|
|
|
|
2018-06-10 21:55:13 +02:00
|
|
|
private final PonyRenderer ears;
|
|
|
|
|
2018-05-26 22:50:30 +02:00
|
|
|
public IPonyData metadata = new PonyData();
|
|
|
|
|
|
|
|
public ModelPonyHead() {
|
|
|
|
super();
|
|
|
|
|
2018-06-10 21:55:13 +02:00
|
|
|
snout = new PonySnout(this, 0, -3, 2);
|
|
|
|
horn = new UnicornHorn(this, 0, 0, 0, -1, 4);
|
|
|
|
|
|
|
|
snout.init(0, 0);
|
|
|
|
|
|
|
|
ears = new PonyRenderer(this, 0, 0).offset(0, -3, 2).around(0, 0, -2)
|
2018-09-09 19:43:54 +02:00
|
|
|
.tex(12, 16).box(-3.999F, -6, 1, 2, 2, 2, 0)
|
|
|
|
.flip().box( 1.999F, -6, 1, 2, 2, 2, 0);
|
2018-06-10 21:55:13 +02:00
|
|
|
|
|
|
|
skeletonHead.addChild(ears);
|
2018-05-26 22:50:30 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public ModelRenderer getHead() {
|
|
|
|
return skeletonHead;
|
|
|
|
}
|
|
|
|
|
2018-06-21 19:28:22 +02:00
|
|
|
@Override
|
|
|
|
public boolean hasHeadGear() {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2018-05-26 22:50:30 +02:00
|
|
|
@Override
|
|
|
|
public void render(Entity entity, float move, float swing, float ticks, float headYaw, float headPitch, float scale) {
|
2018-06-10 21:55:13 +02:00
|
|
|
snout.isHidden = metadata.getRace().isHuman();
|
|
|
|
ears.isHidden = snout.isHidden;
|
2018-05-26 22:50:30 +02:00
|
|
|
|
|
|
|
snout.setGender(metadata.getGender());
|
|
|
|
|
|
|
|
super.render(entity, move, swing, ticks, headYaw, headPitch, scale);
|
|
|
|
|
|
|
|
if (metadata.hasMagic()) {
|
2018-06-10 21:55:13 +02:00
|
|
|
skeletonHead.postRender(scale);
|
2019-01-06 17:07:42 +01:00
|
|
|
horn.renderPart(scale, entity.getUniqueID());
|
2018-05-26 22:50:30 +02:00
|
|
|
}
|
|
|
|
}
|
2018-06-21 19:28:22 +02:00
|
|
|
|
2018-05-26 22:50:30 +02:00
|
|
|
}
|