the game where you go into mines and start crafting! but for consoles (forked directly from smartcmd's github)
at main 34 lines 1.3 kB view raw
1#include "stdafx.h" 2#include "MobSpawnerRenderer.h" 3#include "TileEntityRenderDispatcher.h" 4#include "EntityRenderDispatcher.h" 5#include "..\Minecraft.World\net.minecraft.world.level.tile.entity.h" 6#include "..\Minecraft.World\net.minecraft.world.entity.h" 7 8void MobSpawnerRenderer::render(shared_ptr<TileEntity> _spawner, double x, double y, double z, float a, bool setColor, float alpha, bool useCompiled) 9{ 10 // 4J - dynamic cast required because we aren't using templates/generics in our version 11 shared_ptr<MobSpawnerTileEntity> spawner = dynamic_pointer_cast<MobSpawnerTileEntity>(_spawner); 12 render(spawner->getSpawner(), x, y, z, a); 13 glPopMatrix(); 14} 15 16void MobSpawnerRenderer::render(BaseMobSpawner *spawner, double x, double y, double z, float a) 17{ 18 glPushMatrix(); 19 glTranslatef((float) x + 0.5f, (float) y, (float) z + 0.5f); 20 21 shared_ptr<Entity> e = spawner->getDisplayEntity(); 22 if (e != NULL) 23 { 24 e->setLevel(spawner->getLevel()); 25 float s = 7 / 16.0f; 26 glTranslatef(0, 0.4f, 0); 27 glRotatef((float) (spawner->oSpin + (spawner->spin - spawner->oSpin) * a) * 10, 0, 1, 0); 28 glRotatef(-30, 1, 0, 0); 29 glTranslatef(0, -0.4f, 0); 30 glScalef(s, s, s); 31 e->moveTo(x, y, z, 0, 0); 32 EntityRenderDispatcher::instance->render(e, 0, 0, 0, 0, a); 33 } 34}