the game where you go into mines and start crafting! but for consoles (forked directly from smartcmd's github)
1#include "stdafx.h"
2#include "PigRenderer.h"
3#include "..\Minecraft.World\net.minecraft.world.entity.animal.h"
4
5ResourceLocation PigRenderer::PIG_LOCATION = ResourceLocation(TN_MOB_PIG);
6ResourceLocation PigRenderer::SADDLE_LOCATION = ResourceLocation(TN_MOB_SADDLE);
7
8PigRenderer::PigRenderer(Model *model, Model *armor, float shadow) : MobRenderer(model,shadow)
9{
10 setArmor(armor);
11}
12
13int PigRenderer::prepareArmor(shared_ptr<LivingEntity> _pig, int layer, float a)
14{
15 // 4J - dynamic cast required because we aren't using templates/generics in our version
16 shared_ptr<Pig> pig = dynamic_pointer_cast<Pig>(_pig);
17
18 if (layer == 0 && pig->hasSaddle())
19 {
20 MemSect(31);
21 bindTexture(&SADDLE_LOCATION);
22 MemSect(0);
23
24 return 1;
25 }
26
27 return -1;
28}
29
30void PigRenderer::render(shared_ptr<Entity> mob, double x, double y, double z, float rot, float a)
31{
32 MobRenderer::render(mob, x, y, z, rot, a);
33}
34
35ResourceLocation *PigRenderer::getTextureLocation(shared_ptr<Entity> mob)
36{
37 return &PIG_LOCATION;
38}