the game where you go into mines and start crafting! but for consoles (forked directly from smartcmd's github)
at main 86 lines 2.1 kB view raw
1#include "stdafx.h" 2#include "net.minecraft.world.level.h" 3#include "net.minecraft.world.entity.boss.enderdragon.h" 4#include "net.minecraft.world.level.tile.h" 5#include "EndPodiumFeature.h" 6 7EndPodiumFeature::EndPodiumFeature(int tile) 8{ 9 this->tile = tile; 10 //m_iIndex=0; 11} 12 13bool EndPodiumFeature::place(Level *level, Random *random, int x, int y, int z) 14{ 15 // spawn Exit portal 16 int r = 4; 17 18 for (int yy = y - 1; yy <= y + 32; yy++) 19 { 20 for (int xx = x - r; xx <= x + r; xx++) 21 { 22 for (int zz = z - r; zz <= z + r; zz++) 23 { 24 double xd = xx - x; 25 double zd = zz - z; 26 double d = sqrt(xd * xd + zd * zd); 27 if (d <= r - 0.5) 28 { 29 if (yy < y) 30 { 31 if (d > r - 1 - 0.5) 32 { 33 } 34 else 35 { 36 //level->setTile(xx, yy, zz, Tile::unbreakable_Id); 37 placeBlock(level, xx, yy, zz, Tile::unbreakable_Id, 0); 38 } 39 } 40 else if (yy > y) 41 { 42 //level->setTile(xx, yy, zz, 0); 43 placeBlock(level, xx, yy, zz, 0, 0); 44 } 45 else 46 { 47 if (d > r - 1 - 0.5) 48 { 49 //level->setTile(xx, yy, zz, Tile::unbreakable_Id); 50 placeBlock(level, xx, yy, zz, Tile::unbreakable_Id, 0); 51 } 52 } 53 } 54 } 55 } 56 } 57 58 placeBlock(level,x, y + 0, z, Tile::unbreakable_Id, 0); 59 placeBlock(level,x, y + 1, z, Tile::unbreakable_Id, 0); 60 placeBlock(level,x, y + 2, z, Tile::unbreakable_Id, 0); 61 placeBlock(level,x - 1, y + 2, z, Tile::torch_Id, 0); 62 placeBlock(level,x + 1, y + 2, z, Tile::torch_Id, 0); 63 placeBlock(level,x, y + 2, z - 1, Tile::torch_Id, 0); 64 placeBlock(level,x, y + 2, z + 1, Tile::torch_Id, 0); 65 placeBlock(level,x, y + 3, z, Tile::unbreakable_Id, 0); 66 //placeBlock(level,x, y + 4, z, Tile::dragonEgg_Id, 0); 67 68 // 4J-PB - The podium can be floating with nothing under it, so put some whiteStone under it if this is the case 69 for (int yy = y - 5; yy < y - 1; yy++) 70 { 71 for (int xx = x - (r - 1); xx <= x + (r - 1); xx++) 72 { 73 for (int zz = z - (r - 1); zz <= z + (r - 1); zz++) 74 { 75 if(level->isEmptyTile(xx,yy,zz)) 76 { 77 placeBlock(level, xx, yy, zz, Tile::endStone_Id, 0); 78 } 79 } 80 } 81 } 82 83 84 return true; 85} 86