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 "EnderCrystalModel.h"
3#include "..\Minecraft.World\net.minecraft.world.entity.boss.enderdragon.h"
4#include "EnderCrystalRenderer.h"
5
6ResourceLocation EnderCrystalRenderer::ENDER_CRYSTAL_LOCATION = ResourceLocation(TN_MOB_ENDERDRAGON_ENDERCRYSTAL);
7
8EnderCrystalRenderer::EnderCrystalRenderer()
9{
10 currentModel = -1;
11 this->shadowRadius = 0.5f;
12}
13
14void EnderCrystalRenderer::render(shared_ptr<Entity> _crystal, double x, double y, double z, float rot, float a)
15{
16 // 4J - original version used generics and thus had an input parameter of type EnderCrystal rather than shared_ptr<Entity> we have here -
17 // do some casting around instead
18 shared_ptr<EnderCrystal> crystal = dynamic_pointer_cast<EnderCrystal>(_crystal);
19 if (currentModel != EnderCrystalModel::MODEL_ID)
20 {
21 model = new EnderCrystalModel(0);
22 currentModel = EnderCrystalModel::MODEL_ID;
23 }
24
25
26 float tt = crystal->time + a;
27 glPushMatrix();
28 glTranslatef((float) x, (float) y, (float) z);
29 bindTexture(&ENDER_CRYSTAL_LOCATION);
30 float hh = sin(tt * 0.2f) / 2 + 0.5f;
31 hh = hh * hh + hh;
32 model->render(crystal, 0, tt * 3, hh * 0.2f, 0, 0, 1 / 16.0f, true);
33
34 glPopMatrix();
35}
36
37ResourceLocation *EnderCrystalRenderer::getTextureLocation(shared_ptr<Entity> mob)
38{
39 return &ENDER_CRYSTAL_LOCATION;
40}