forked from mirrors/kolyah35-minecraft-pe-0.6.1
the whole game
This commit is contained in:
parent
816e9060b4
commit
f0617a5d22
2069 changed files with 581500 additions and 0 deletions
26
src/world/level/tile/SandTile.cpp
Executable file
26
src/world/level/tile/SandTile.cpp
Executable file
|
|
@ -0,0 +1,26 @@
|
|||
#include "SandTile.h"
|
||||
#include "../../entity/item/FallingTile.h"
|
||||
|
||||
bool SandTile::instaFall = false;
|
||||
|
||||
/*private*/
|
||||
void SandTile::checkSlide(Level* level, int x, int y, int z)
|
||||
{
|
||||
int x2 = x;
|
||||
int y2 = y;
|
||||
int z2 = z;
|
||||
if (isFree(level, x2, y2 - 1, z2) && y2 >= 0) {
|
||||
int r = 32;
|
||||
if (instaFall || !level->hasChunksAt(x - r, y - r, z - r, x + r, y + r, z + r)) {
|
||||
level->setTile(x, y, z, 0);
|
||||
while (isFree(level, x, y - 1, z) && y > 0)
|
||||
y--;
|
||||
if (y > 0) {
|
||||
level->setTile(x, y, z, id);
|
||||
}
|
||||
} else {
|
||||
FallingTile* e = new FallingTile(level, x + 0.5f, y + 0.5f, z + 0.5f, id);
|
||||
level->addEntity(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue