Initial commit
This commit is contained in:
parent
def8cb4153
commit
b691c43c44
19437 changed files with 4363922 additions and 0 deletions
29
Minecraft.World/SpringTile.cpp
Normal file
29
Minecraft.World/SpringTile.cpp
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
#include "stdafx.h"
|
||||
#include "net.minecraft.world.level.h"
|
||||
|
||||
#include "SpringTile.h"
|
||||
|
||||
|
||||
SpringTile::SpringTile(int id, int liquidTileId) : Tile(id, Material::water)
|
||||
{
|
||||
this->liquidTileId = liquidTileId;
|
||||
this->setTicking(true);
|
||||
}
|
||||
|
||||
void SpringTile::onPlace(Level *level, int x, int y, int z)
|
||||
{
|
||||
Tile::onPlace(level, x, y, z);
|
||||
if (level->isEmptyTile(x-1, y, z)) level->setTile(x-1, y, z, liquidTileId);
|
||||
if (level->isEmptyTile(x+1, y, z)) level->setTile(x+1, y, z, liquidTileId);
|
||||
if (level->isEmptyTile(x, y, z-1)) level->setTile(x, y, z-1, liquidTileId);
|
||||
if (level->isEmptyTile(x, y, z+1)) level->setTile(x, y, z+1, liquidTileId);
|
||||
}
|
||||
|
||||
void SpringTile::tick(Level *level, int x, int y, int z, Random *random)
|
||||
{
|
||||
Tile::tick(level, x, y, z, random);
|
||||
if (level->isEmptyTile(x-1, y, z)) level->setTile(x-1, y, z, liquidTileId);
|
||||
if (level->isEmptyTile(x+1, y, z)) level->setTile(x+1, y, z, liquidTileId);
|
||||
if (level->isEmptyTile(x, y, z-1)) level->setTile(x, y, z-1, liquidTileId);
|
||||
if (level->isEmptyTile(x, y, z+1)) level->setTile(x, y, z+1, liquidTileId);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue