mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/4jcraft.git
synced 2026-06-29 23:15:46 +00:00
chore: format Minecraft.World
This commit is contained in:
@@ -3,41 +3,41 @@
|
||||
#include "../../Headers/net.minecraft.world.level.tile.h"
|
||||
#include "GroundBushFeature.h"
|
||||
|
||||
GroundBushFeature::GroundBushFeature(int trunkType, int leafType)
|
||||
{
|
||||
this->trunkTileType = trunkType;
|
||||
this->leafTileType = leafType;
|
||||
GroundBushFeature::GroundBushFeature(int trunkType, int leafType) {
|
||||
this->trunkTileType = trunkType;
|
||||
this->leafTileType = leafType;
|
||||
}
|
||||
|
||||
bool GroundBushFeature::place(Level *level, Random *random, int x, int y, int z)
|
||||
{
|
||||
PIXBeginNamedEvent(0,"Placing GroundBushFeature");
|
||||
int t = 0;
|
||||
while (((t = level->getTile(x, y, z)) == 0 || t == Tile::leaves_Id) && y > 0)
|
||||
y--;
|
||||
bool GroundBushFeature::place(Level* level, Random* random, int x, int y,
|
||||
int z) {
|
||||
PIXBeginNamedEvent(0, "Placing GroundBushFeature");
|
||||
int t = 0;
|
||||
while (((t = level->getTile(x, y, z)) == 0 || t == Tile::leaves_Id) &&
|
||||
y > 0)
|
||||
y--;
|
||||
|
||||
int tile = level->getTile(x, y, z);
|
||||
if (tile == Tile::dirt_Id || tile == Tile::grass_Id)
|
||||
{
|
||||
y++;
|
||||
placeBlock(level, x, y, z, Tile::treeTrunk_Id, trunkTileType);
|
||||
int tile = level->getTile(x, y, z);
|
||||
if (tile == Tile::dirt_Id || tile == Tile::grass_Id) {
|
||||
y++;
|
||||
placeBlock(level, x, y, z, Tile::treeTrunk_Id, trunkTileType);
|
||||
|
||||
for (int yy = y; yy <= y + 2; yy++)
|
||||
{
|
||||
int yo = yy - y;
|
||||
int offs = 2 - yo;
|
||||
for (int xx = x - offs; xx <= x + offs; xx++)
|
||||
{
|
||||
int xo = xx - (x);
|
||||
for (int zz = z - offs; zz <= z + offs; zz++)
|
||||
{
|
||||
int zo = zz - (z);
|
||||
if (abs(xo) == offs && abs(zo) == offs && random->nextInt(2) == 0) continue;
|
||||
if (!Tile::solid[level->getTile(xx, yy, zz)]) placeBlock(level, xx, yy, zz, Tile::leaves_Id, leafTileType);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
PIXEndNamedEvent();
|
||||
return true;
|
||||
for (int yy = y; yy <= y + 2; yy++) {
|
||||
int yo = yy - y;
|
||||
int offs = 2 - yo;
|
||||
for (int xx = x - offs; xx <= x + offs; xx++) {
|
||||
int xo = xx - (x);
|
||||
for (int zz = z - offs; zz <= z + offs; zz++) {
|
||||
int zo = zz - (z);
|
||||
if (abs(xo) == offs && abs(zo) == offs &&
|
||||
random->nextInt(2) == 0)
|
||||
continue;
|
||||
if (!Tile::solid[level->getTile(xx, yy, zz)])
|
||||
placeBlock(level, xx, yy, zz, Tile::leaves_Id,
|
||||
leafTileType);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
PIXEndNamedEvent();
|
||||
return true;
|
||||
}
|
||||
Reference in New Issue
Block a user