the game where you go into mines and start crafting! but for consoles (forked directly from smartcmd's github)
at main 38 lines 898 B view raw
1#include "stdafx.h" 2#include "net.minecraft.world.level.h" 3#include "net.minecraft.world.level.material.h" 4#include "ClayFeature.h" 5#include "net.minecraft.world.level.tile.h" 6 7ClayFeature::ClayFeature(int radius) 8{ 9 this->tile = Tile::clay_Id; 10 this->radius = radius; 11} 12 13bool ClayFeature::place(Level *level, Random *random, int x, int y, int z) 14{ 15 if (level->getMaterial(x, y, z) != Material::water) return false; 16 17 int r = random->nextInt(radius - 2) + 2; 18 int yr = 1; 19 for (int xx = x - r; xx <= x + r; xx++) 20 { 21 for (int zz = z - r; zz <= z + r; zz++) 22 { 23 int xd = xx - x; 24 int zd = zz - z; 25 if (xd * xd + zd * zd > r * r) continue; 26 for (int yy = y - yr; yy <= y + yr; yy++) 27 { 28 int t = level->getTile(xx, yy, zz); 29 if (t == Tile::dirt_Id || t == Tile::clay_Id) 30 { 31 level->setTileAndData(xx, yy, zz, tile, 0, Tile::UPDATE_CLIENTS); 32 } 33 } 34 } 35 } 36 37 return true; 38}