the game where you go into mines and start crafting! but for consoles (forked directly from smartcmd's github)
at main 41 lines 1.3 kB view raw
1#include "stdafx.h" 2#include "net.minecraft.world.level.h" 3#include "net.minecraft.world.level.dimension.h" 4#include "FlowerFeature.h" 5#include "net.minecraft.world.level.tile.h" 6 7FlowerFeature::FlowerFeature(int tile) 8{ 9 this->tile = tile; 10} 11 12bool FlowerFeature::place(Level *level, Random *random, int x, int y, int z) 13{ 14 // 4J Stu Added to stop tree features generating areas previously place by game rule generation 15 if(app.getLevelGenerationOptions() != NULL) 16 { 17 LevelGenerationOptions *levelGenOptions = app.getLevelGenerationOptions(); 18 bool intersects = levelGenOptions->checkIntersects(x - 8, y - 4, z - 8, x + 8, y + 4, z + 8); 19 if(intersects) 20 { 21 //app.DebugPrintf("Skipping reeds feature generation as it overlaps a game rule structure\n"); 22 return false; 23 } 24 } 25 26 for (int i = 0; i < 64; i++) 27 { 28 int x2 = x + random->nextInt(8) - random->nextInt(8); 29 int y2 = y + random->nextInt(4) - random->nextInt(4); 30 int z2 = z + random->nextInt(8) - random->nextInt(8); 31 if (level->isEmptyTile(x2, y2, z2) && (!level->dimension->hasCeiling || y2 < Level::genDepthMinusOne)) 32 { 33 if (Tile::tiles[tile]->canSurvive(level, x2, y2, z2)) 34 { 35 level->setTileAndData(x2, y2, z2, tile, 0, Tile::UPDATE_CLIENTS); 36 } 37 } 38 } 39 40 return true; 41}