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 "..\Minecraft.World\net.minecraft.world.level.tile.entity.h"
3#include "ModelPart.h"
4#include "EnderChestRenderer.h"
5
6ResourceLocation EnderChestRenderer::ENDER_CHEST_LOCATION = ResourceLocation(TN_TILE_ENDER_CHEST);
7
8void EnderChestRenderer::render(shared_ptr<TileEntity> _chest, double x, double y, double z, float a, bool setColor, float alpha, bool useCompiled)
9{
10 // 4J Convert as we aren't using a templated class
11 shared_ptr<EnderChestTileEntity> chest = dynamic_pointer_cast<EnderChestTileEntity>(_chest);
12
13 int data = 0;
14
15 if (chest->hasLevel())
16 {
17 data = chest->getData();
18 }
19
20 bindTexture(&ENDER_CHEST_LOCATION);
21
22 glPushMatrix();
23 glEnable(GL_RESCALE_NORMAL);
24 //glColor4f(1, 1, 1, 1);
25 if( setColor ) glColor4f(1, 1, 1, alpha);
26 glTranslatef((float) x, (float) y + 1, (float) z + 1);
27 glScalef(1, -1, -1);
28
29 glTranslatef(0.5f, 0.5f, 0.5f);
30 int rot = 0;
31 if (data == 2) rot = 180;
32 if (data == 3) rot = 0;
33 if (data == 4) rot = 90;
34 if (data == 5) rot = -90;
35
36 glRotatef(rot, 0, 1, 0);
37 glTranslatef(-0.5f, -0.5f, -0.5f);
38
39 float open = chest->oOpenness + (chest->openness - chest->oOpenness) * a;
40 open = 1 - open;
41 open = 1 - open * open * open;
42
43 chestModel.lid->xRot = -(open * PI / 2);
44 chestModel.render(useCompiled);
45 glDisable(GL_RESCALE_NORMAL);
46 glPopMatrix();
47 if( setColor ) glColor4f(1, 1, 1, 1);
48}