the game where you go into mines and start crafting! but for consoles (forked directly from smartcmd's github)
1#include "stdafx.h"
2#include "net.minecraft.world.level.h"
3
4#include "SpringTile.h"
5
6
7SpringTile::SpringTile(int id, int liquidTileId) : Tile(id, Material::water)
8{
9 this->liquidTileId = liquidTileId;
10 this->setTicking(true);
11}
12
13void SpringTile::onPlace(Level *level, int x, int y, int z)
14{
15 Tile::onPlace(level, x, y, z);
16 if (level->isEmptyTile(x-1, y, z)) level->setTile(x-1, y, z, liquidTileId);
17 if (level->isEmptyTile(x+1, y, z)) level->setTile(x+1, y, z, liquidTileId);
18 if (level->isEmptyTile(x, y, z-1)) level->setTile(x, y, z-1, liquidTileId);
19 if (level->isEmptyTile(x, y, z+1)) level->setTile(x, y, z+1, liquidTileId);
20}
21
22void SpringTile::tick(Level *level, int x, int y, int z, Random *random)
23{
24 Tile::tick(level, x, y, z, random);
25 if (level->isEmptyTile(x-1, y, z)) level->setTile(x-1, y, z, liquidTileId);
26 if (level->isEmptyTile(x+1, y, z)) level->setTile(x+1, y, z, liquidTileId);
27 if (level->isEmptyTile(x, y, z-1)) level->setTile(x, y, z-1, liquidTileId);
28 if (level->isEmptyTile(x, y, z+1)) level->setTile(x, y, z+1, liquidTileId);
29}