fix: sunflower

FINALLY IT WORKS NOW IN THE TUTORIAL WORLD
RAHHHHHHHHHHHHHHHHHHHHHHHHHHHH
This commit is contained in:
Fireblade
2026-05-28 16:31:14 -04:00
parent 322d426868
commit 31d5c12f8f
3 changed files with 29 additions and 13 deletions
+7
View File
@@ -18,6 +18,13 @@ TerrainParticle::TerrainParticle(Level *level, double x, double y, double z, dou
shared_ptr<TerrainParticle> TerrainParticle::init(int x, int y, int z, int data) // 4J - added data parameter
{
if (tile == nullptr) return nullptr; // tu31 tutorial world fix
// double check particle texture cause sunflowers are dysfunctional for whatever reason
Icon *resolvedIcon = tile->getTexture(level, x, y, z, 0);
if (resolvedIcon != nullptr)
{
setTex(Minecraft::GetInstance()->textures, resolvedIcon);
}
if (tile == Tile::grass) return dynamic_pointer_cast<TerrainParticle>( shared_from_this() );
int col = tile->getColor(level, x, y, z, data); // 4J - added data parameter
rCol *= ((col >> 16) & 0xff) / 255.0f;
+7 -1
View File
@@ -12,6 +12,7 @@
#include "../Minecraft.World/JavaMath.h"
#include "Tesselator.h"
#include "EntityTileRenderer.h"
#include "LevelRenderer.h"
#include "Options.h"
#include "../Minecraft.World/TallGrass2.h"
@@ -4199,6 +4200,10 @@ bool TileRenderer::tesselateCrossInWorld( Tile* tt, int x, int y, int z )
{
const int data = level->getData(x, y, z);
const bool isUpper = (data & TallGrass2::UPPER_BIT) != 0;
if (isUpper && level->getTile(x, y - 1, z) != Tile::double_plant_Id)
{
return true;
}
int lowerData = data;
if (isUpper && level->getTile(x, y - 1, z) == Tile::double_plant_Id)
{
@@ -4209,7 +4214,8 @@ bool TileRenderer::tesselateCrossInWorld( Tile* tt, int x, int y, int z )
if (isUpper && variant == TallGrass2::SUNFLOWER)
{
// cut off stem height (i think thats how it was in the original LCE?)
tesselateCrossStemHeight(tt, data, xt, yt, zt, 0.875f);
const int stemRenderData = (lowerData & ~TallGrass2::UPPER_BIT) | TallGrass2::UPPER_BIT;
tesselateCrossStemHeight(tt, stemRenderData, xt, yt, zt, 0.875f);
TallGrass2* tallGrass = static_cast<TallGrass2*>(tt);
Icon* frontTex = tallGrass->getSunflowerHeadFrontIcon();
Icon* backTex = tallGrass->getSunflowerHeadBackIcon();