the game where you go into mines and start crafting! but for consoles (forked directly from smartcmd's github)
at main 33 lines 785 B view raw
1#include "stdafx.h" 2#include "net.minecraft.world.level.h" 3#include "DeadBushFeature.h" 4#include "net.minecraft.world.level.tile.h" 5 6DeadBushFeature::DeadBushFeature(int tile) 7{ 8 this->tile = tile; 9} 10 11bool DeadBushFeature::place(Level *level, Random *random, int x, int y, int z) 12{ 13 int t = 0; 14 while (((t = level->getTile(x, y, z)) == 0 || t == Tile::leaves_Id) && y > 0) 15 y--; 16 17 for (int i = 0; i < 4; i++) 18 { 19 int x2 = x + random->nextInt(8) - random->nextInt(8); 20 int y2 = y + random->nextInt(4) - random->nextInt(4); 21 int z2 = z + random->nextInt(8) - random->nextInt(8); 22 if (level->isEmptyTile(x2, y2, z2) ) 23 { 24 if (Tile::tiles[tile]->canSurvive(level, x2, y2, z2)) 25 { 26 level->setTileAndData(x2, y2, z2, tile, 0, Tile::UPDATE_CLIENTS); 27 } 28 } 29 } 30 31 return true; 32 33}