mirror of
https://github.com/MineLittlePony/MineLittlePony.git
synced 2025-02-13 08:14:23 +01:00
Fixed villagers having bat features when the're not supposed to
This commit is contained in:
parent
2a2f08b939
commit
5d88aedfbf
3 changed files with 22 additions and 3 deletions
|
@ -10,11 +10,13 @@ import net.minecraft.util.math.MathHelper;
|
|||
import net.minecraft.village.VillagerDataContainer;
|
||||
import net.minecraft.village.VillagerProfession;
|
||||
|
||||
import com.minelittlepony.pony.IPony;
|
||||
import com.minelittlepony.pony.meta.Race;
|
||||
import com.minelittlepony.client.model.entity.race.AlicornModel;
|
||||
import com.minelittlepony.client.render.EquineRenderManager;
|
||||
import com.minelittlepony.client.render.entity.npc.PonyTextures;
|
||||
import com.minelittlepony.model.IPart;
|
||||
import com.minelittlepony.mson.api.ModelContext;
|
||||
import com.minelittlepony.pony.meta.Race;
|
||||
|
||||
public class VillagerPonyModel<T extends LivingEntity & VillagerDataContainer> extends AlicornModel<T> implements ModelWithHat {
|
||||
|
||||
|
@ -22,6 +24,7 @@ public class VillagerPonyModel<T extends LivingEntity & VillagerDataContainer> e
|
|||
private ModelPart trinket;
|
||||
|
||||
private IPart batWings;
|
||||
private IPart batEars;
|
||||
|
||||
public VillagerPonyModel() {
|
||||
super(false);
|
||||
|
@ -30,10 +33,20 @@ public class VillagerPonyModel<T extends LivingEntity & VillagerDataContainer> e
|
|||
@Override
|
||||
public void init(ModelContext context) {
|
||||
super.init(context);
|
||||
batWings = context.findByName("bat_wings");
|
||||
batEars = context.findByName("bat_ears");
|
||||
apron = context.findByName("apron");
|
||||
trinket = context.findByName("trinket");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateLivingState(T entity, IPony pony, EquineRenderManager.Mode mode) {
|
||||
super.updateLivingState(entity, pony, mode);
|
||||
|
||||
ears.setVisible(pony.getMetadata().getRace() != Race.BATPONY);
|
||||
batEars.setVisible(pony.getMetadata().getRace() == Race.BATPONY);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPart getWings() {
|
||||
if (getMetadata().getRace() == Race.BATPONY) {
|
||||
|
|
|
@ -65,8 +65,8 @@ public class MagicGlow extends RenderPhase {
|
|||
|
||||
@Override
|
||||
public void startDrawing() {
|
||||
super.startDrawing();
|
||||
RenderSystem.blendColor(red, green, blue, alpha);
|
||||
super.startDrawing();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -16,6 +16,12 @@
|
|||
"type": "mson:slot",
|
||||
"name": "ears",
|
||||
"implementation": "com.minelittlepony.client.model.part.PonyEars",
|
||||
"content": "minelittlepony:components/ears"
|
||||
},
|
||||
{
|
||||
"type": "mson:slot",
|
||||
"name": "bat_ears",
|
||||
"implementation": "com.minelittlepony.client.model.part.PonyEars",
|
||||
"content": "minelittlepony:components/bat_ears"
|
||||
},
|
||||
{
|
||||
|
@ -28,7 +34,7 @@
|
|||
},
|
||||
"bat_wings": {
|
||||
"type": "mson:slot",
|
||||
"name": "wings",
|
||||
"name": "bat_wings",
|
||||
"implementation": "com.minelittlepony.client.model.part.BatWings",
|
||||
"content": "minelittlepony:components/bat_wings"
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue