mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/4jcraft.git
synced 2026-07-13 05:58:34 +00:00
chore: format Minecraft.Client
This commit is contained in:
@@ -3,50 +3,51 @@
|
||||
#include "../Models/ModelPart.h"
|
||||
#include "EnderChestRenderer.h"
|
||||
|
||||
void EnderChestRenderer::render(std::shared_ptr<TileEntity> _chest, double x, double y, double z, float a, bool setColor, float alpha, bool useCompiled)
|
||||
{
|
||||
// 4J Convert as we aren't using a templated class
|
||||
std::shared_ptr<EnderChestTileEntity> chest = std::dynamic_pointer_cast<EnderChestTileEntity>(_chest);
|
||||
void EnderChestRenderer::render(std::shared_ptr<TileEntity> _chest, double x,
|
||||
double y, double z, float a, bool setColor,
|
||||
float alpha, bool useCompiled) {
|
||||
// 4J Convert as we aren't using a templated class
|
||||
std::shared_ptr<EnderChestTileEntity> chest =
|
||||
std::dynamic_pointer_cast<EnderChestTileEntity>(_chest);
|
||||
|
||||
int data = 0;
|
||||
int data = 0;
|
||||
|
||||
if (chest->hasLevel())
|
||||
{
|
||||
data = chest->getData();
|
||||
}
|
||||
if (chest->hasLevel()) {
|
||||
data = chest->getData();
|
||||
}
|
||||
|
||||
bindTexture(TN_TILE_ENDER_CHEST); //"/item/enderchest.png");
|
||||
bindTexture(TN_TILE_ENDER_CHEST); //"/item/enderchest.png");
|
||||
|
||||
glPushMatrix();
|
||||
glEnable(GL_RESCALE_NORMAL);
|
||||
//glColor4f(1, 1, 1, 1);
|
||||
if( setColor ) glColor4f(1, 1, 1, alpha);
|
||||
glTranslatef((float) x, (float) y + 1, (float) z + 1);
|
||||
glScalef(1, -1, -1);
|
||||
glPushMatrix();
|
||||
glEnable(GL_RESCALE_NORMAL);
|
||||
// glColor4f(1, 1, 1, 1);
|
||||
if (setColor) glColor4f(1, 1, 1, alpha);
|
||||
glTranslatef((float)x, (float)y + 1, (float)z + 1);
|
||||
glScalef(1, -1, -1);
|
||||
|
||||
glTranslatef(0.5f, 0.5f, 0.5f);
|
||||
int rot = 0;
|
||||
if (data == 2) rot = 180;
|
||||
if (data == 3) rot = 0;
|
||||
if (data == 4) rot = 90;
|
||||
if (data == 5) rot = -90;
|
||||
glTranslatef(0.5f, 0.5f, 0.5f);
|
||||
int rot = 0;
|
||||
if (data == 2) rot = 180;
|
||||
if (data == 3) rot = 0;
|
||||
if (data == 4) rot = 90;
|
||||
if (data == 5) rot = -90;
|
||||
|
||||
// if (data == 2) {
|
||||
// glTranslatef(1, 0, 0);
|
||||
// }
|
||||
// if (data == 5) {
|
||||
// glTranslatef(0, 0, -1);
|
||||
// }
|
||||
glRotatef(rot, 0, 1, 0);
|
||||
glTranslatef(-0.5f, -0.5f, -0.5f);
|
||||
// if (data == 2) {
|
||||
// glTranslatef(1, 0, 0);
|
||||
// }
|
||||
// if (data == 5) {
|
||||
// glTranslatef(0, 0, -1);
|
||||
// }
|
||||
glRotatef(rot, 0, 1, 0);
|
||||
glTranslatef(-0.5f, -0.5f, -0.5f);
|
||||
|
||||
float open = chest->oOpenness + (chest->openness - chest->oOpenness) * a;
|
||||
open = 1 - open;
|
||||
open = 1 - open * open * open;
|
||||
float open = chest->oOpenness + (chest->openness - chest->oOpenness) * a;
|
||||
open = 1 - open;
|
||||
open = 1 - open * open * open;
|
||||
|
||||
chestModel.lid->xRot = -(open * PI / 2);
|
||||
chestModel.render(useCompiled);
|
||||
glDisable(GL_RESCALE_NORMAL);
|
||||
glPopMatrix();
|
||||
if( setColor ) glColor4f(1, 1, 1, 1);
|
||||
chestModel.lid->xRot = -(open * PI / 2);
|
||||
chestModel.render(useCompiled);
|
||||
glDisable(GL_RESCALE_NORMAL);
|
||||
glPopMatrix();
|
||||
if (setColor) glColor4f(1, 1, 1, 1);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user