chore: format Minecraft.Client

This commit is contained in:
Tropical
2026-03-13 17:10:10 -05:00
parent 33d0737d1d
commit e8424f2000
531 changed files with 67709 additions and 62690 deletions

View File

@@ -3,27 +3,27 @@
#include "../Tesselator.h"
#include "../../../Minecraft.World/Headers/net.minecraft.world.entity.global.h"
void LightningBoltRenderer::render(std::shared_ptr<Entity> _bolt, double x, double y, double z, float rot, float a)
{
// 4J - dynamic cast required because we aren't using templates/generics in our version
std::shared_ptr<LightningBolt> bolt = std::dynamic_pointer_cast<LightningBolt>(_bolt);
void LightningBoltRenderer::render(std::shared_ptr<Entity> _bolt, double x,
double y, double z, float rot, float a) {
// 4J - dynamic cast required because we aren't using templates/generics in
// our version
std::shared_ptr<LightningBolt> bolt =
std::dynamic_pointer_cast<LightningBolt>(_bolt);
Tesselator *t = Tesselator::getInstance();
Tesselator* t = Tesselator::getInstance();
glDisable(GL_TEXTURE_2D);
glDisable(GL_LIGHTING);
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE);
double xOffs[8];
double zOffs[8];
double xOff = 0;
double zOff = 0;
{
Random *random = new Random(bolt->seed);
for (int h = 7; h >= 0; h--)
{
Random* random = new Random(bolt->seed);
for (int h = 7; h >= 0; h--) {
xOffs[h] = xOff;
zOffs[h] = zOff;
xOff += random->nextInt(11) - 5;
@@ -31,28 +31,22 @@ void LightningBoltRenderer::render(std::shared_ptr<Entity> _bolt, double x, doub
}
}
for (int r = 0; r < 4; r++)
{
Random *random = new Random(bolt->seed);
for (int p = 0; p < 3; p++)
{
for (int r = 0; r < 4; r++) {
Random* random = new Random(bolt->seed);
for (int p = 0; p < 3; p++) {
int hs = 7;
int ht = 0;
if (p > 0) hs = 7 - p;
if (p > 0) ht = hs - 2;
double xo0 = xOffs[hs] - xOff;
double zo0 = zOffs[hs] - zOff;
for (int h = hs; h >= ht; h--)
{
for (int h = hs; h >= ht; h--) {
double xo1 = xo0;
double zo1 = zo0;
if (p == 0)
{
if (p == 0) {
xo0 += random->nextInt(11) - 5;
zo0 += random->nextInt(11) - 5;
}
else
{
} else {
xo0 += random->nextInt(31) - 15;
zo0 += random->nextInt(31) - 15;
}
@@ -65,10 +59,9 @@ void LightningBoltRenderer::render(std::shared_ptr<Entity> _bolt, double x, doub
if (p == 0) rr1 *= (h * 0.1 + 1);
double rr2 = (0.1 + r * 0.2);
if (p == 0) rr2 *= ((h-1) * 0.1 + 1);
if (p == 0) rr2 *= ((h - 1) * 0.1 + 1);
for (int i = 0; i < 5; i++)
{
for (int i = 0; i < 5; i++) {
double xx1 = x + 0.5 - rr1;
double zz1 = z + 0.5 - rr1;
if (i == 1 || i == 2) xx1 += rr1 * 2;
@@ -79,9 +72,10 @@ void LightningBoltRenderer::render(std::shared_ptr<Entity> _bolt, double x, doub
if (i == 1 || i == 2) xx2 += rr2 * 2;
if (i == 2 || i == 3) zz2 += rr2 * 2;
t->vertex((float)(xx2 + xo0), (float)( y + (h) * 16), (float)( zz2 + zo0));
t->vertex((float)(xx1 + xo1), (float)( y + (h + 1) * 16), (float)( zz1 + zo1));
t->vertex((float)(xx2 + xo0), (float)(y + (h) * 16),
(float)(zz2 + zo0));
t->vertex((float)(xx1 + xo1), (float)(y + (h + 1) * 16),
(float)(zz1 + zo1));
}
t->end();
@@ -89,9 +83,7 @@ void LightningBoltRenderer::render(std::shared_ptr<Entity> _bolt, double x, doub
}
}
glDisable(GL_BLEND);
glEnable(GL_LIGHTING);
glEnable(GL_TEXTURE_2D);
}