chore: format Minecraft.World

This commit is contained in:
Tropical
2026-03-13 17:06:56 -05:00
parent bd6284025d
commit 33d0737d1d
1511 changed files with 108661 additions and 115521 deletions

View File

@@ -3,28 +3,25 @@
#include "LiquidTileStatic.h"
#include "FireTile.h"
LiquidTileStatic::LiquidTileStatic(int id, Material *material) : LiquidTile(id, material)
{
LiquidTileStatic::LiquidTileStatic(int id, Material* material)
: LiquidTile(id, material) {
setTicking(false);
if (material == Material::lava) setTicking(true);
}
bool LiquidTileStatic::isPathfindable(LevelSource *level, int x, int y, int z)
{
return material != Material::lava;
bool LiquidTileStatic::isPathfindable(LevelSource* level, int x, int y, int z) {
return material != Material::lava;
}
void LiquidTileStatic::neighborChanged(Level *level, int x, int y, int z, int type)
{
void LiquidTileStatic::neighborChanged(Level* level, int x, int y, int z,
int type) {
LiquidTile::neighborChanged(level, x, y, z, type);
if (level->getTile(x, y, z) == id)
{
if (level->getTile(x, y, z) == id) {
setDynamic(level, x, y, z);
}
}
void LiquidTileStatic::setDynamic(Level *level, int x, int y, int z)
{
void LiquidTileStatic::setDynamic(Level* level, int x, int y, int z) {
int d = level->getData(x, y, z);
level->noNeighborUpdate = true;
level->setTileAndDataNoUpdate(x, y, z, id - 1, d);
@@ -33,53 +30,43 @@ void LiquidTileStatic::setDynamic(Level *level, int x, int y, int z)
level->noNeighborUpdate = false;
}
void LiquidTileStatic::tick(Level *level, int x, int y, int z, Random *random)
{
if (material == Material::lava)
{
void LiquidTileStatic::tick(Level* level, int x, int y, int z, Random* random) {
if (material == Material::lava) {
int h = random->nextInt(3);
for (int i = 0; i < h; i++)
{
for (int i = 0; i < h; i++) {
x += random->nextInt(3) - 1;
y++;
z += random->nextInt(3) - 1;
int t = level->getTile(x, y, z);
if (t == 0)
{
if (t == 0) {
if (isFlammable(level, x - 1, y, z) ||
isFlammable(level, x + 1, y, z) ||
isFlammable(level, x, y, z - 1) ||
isFlammable(level, x, y, z + 1) ||
isFlammable(level, x, y - 1, z) ||
isFlammable(level, x, y + 1, z))
{
isFlammable(level, x + 1, y, z) ||
isFlammable(level, x, y, z - 1) ||
isFlammable(level, x, y, z + 1) ||
isFlammable(level, x, y - 1, z) ||
isFlammable(level, x, y + 1, z)) {
level->setTile(x, y, z, Tile::fire_Id);
return;
}
}
else if (Tile::tiles[t]->material->blocksMotion())
{
} else if (Tile::tiles[t]->material->blocksMotion()) {
return;
}
}
if (h == 0)
{
int ox = x;
int oz = z;
for (int i = 0; i< 3; i++)
{
x = ox + random->nextInt(3) - 1;
z = oz + random->nextInt(3) - 1;
if (level->isEmptyTile(x, y + 1, z) && isFlammable(level, x, y, z)) {
level->setTile(x, y + 1, z, Tile::fire_Id);
}
}
}
if (h == 0) {
int ox = x;
int oz = z;
for (int i = 0; i < 3; i++) {
x = ox + random->nextInt(3) - 1;
z = oz + random->nextInt(3) - 1;
if (level->isEmptyTile(x, y + 1, z) &&
isFlammable(level, x, y, z)) {
level->setTile(x, y + 1, z, Tile::fire_Id);
}
}
}
}
}
bool LiquidTileStatic::isFlammable(Level *level, int x, int y, int z)
{
return level->getMaterial(x, y, z)->isFlammable();
bool LiquidTileStatic::isFlammable(Level* level, int x, int y, int z) {
return level->getMaterial(x, y, z)->isFlammable();
}