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 "SnowManModel.h"
3#include "..\Minecraft.World\net.minecraft.world.entity.animal.h"
4#include "..\Minecraft.World\net.minecraft.world.level.tile.h"
5#include "..\Minecraft.World\net.minecraft.world.item.h"
6#include "ModelPart.h"
7#include "EntityRenderDispatcher.h"
8#include "SnowManRenderer.h"
9
10ResourceLocation SnowManRenderer::SNOWMAN_LOCATION = ResourceLocation(TN_MOB_SNOWMAN);
11
12SnowManRenderer::SnowManRenderer() : MobRenderer(new SnowManModel(), 0.5f)
13{
14 model = (SnowManModel *) MobRenderer::model;
15 this->setArmor(model);
16}
17
18void SnowManRenderer::additionalRendering(shared_ptr<LivingEntity> _mob, float a)
19{
20 // 4J - original version used generics and thus had an input parameter of type SnowMan rather than shared_ptr<Mob> we have here -
21 // do some casting around instead
22 shared_ptr<SnowMan> mob = dynamic_pointer_cast<SnowMan>(_mob);
23
24 MobRenderer::additionalRendering(mob, a);
25 shared_ptr<ItemInstance> headGear = shared_ptr<ItemInstance>( new ItemInstance(Tile::pumpkin, 1) );
26 if (headGear != NULL && headGear->getItem()->id < 256)
27 {
28 glPushMatrix();
29 model->head->translateTo(1 / 16.0f);
30
31 if (TileRenderer::canRender(Tile::tiles[headGear->id]->getRenderShape()))
32 {
33 float s = 10 / 16.0f;
34 glTranslatef(-0 / 16.0f, -5.5f / 16.0f, 0 / 16.0f);
35 glRotatef(90, 0, 1, 0);
36 glScalef(s, -s, s);
37 }
38
39 entityRenderDispatcher->itemInHandRenderer->renderItem(mob, headGear, 0);
40
41 glPopMatrix();
42 }
43}
44
45ResourceLocation *SnowManRenderer::getTextureLocation(shared_ptr<Entity> mob)
46{
47 return &SNOWMAN_LOCATION;
48}