diff options
| author | daoge_cmd <3523206925@qq.com> | 2026-03-01 12:16:08 +0800 |
|---|---|---|
| committer | daoge_cmd <3523206925@qq.com> | 2026-03-01 12:16:08 +0800 |
| commit | b691c43c44ff180d10e7d4a9afc83b98551ff586 (patch) | |
| tree | 3e9849222cbc6ba49f2f1fc6e5fe7179632c7390 /Minecraft.World/EndPodiumFeature.cpp | |
| parent | def8cb415354ac390b7e89052a50605285f1aca9 (diff) | |
Initial commit
Diffstat (limited to 'Minecraft.World/EndPodiumFeature.cpp')
| -rw-r--r-- | Minecraft.World/EndPodiumFeature.cpp | 86 |
1 files changed, 86 insertions, 0 deletions
diff --git a/Minecraft.World/EndPodiumFeature.cpp b/Minecraft.World/EndPodiumFeature.cpp new file mode 100644 index 00000000..261b6446 --- /dev/null +++ b/Minecraft.World/EndPodiumFeature.cpp @@ -0,0 +1,86 @@ +#include "stdafx.h" +#include "net.minecraft.world.level.h" +#include "net.minecraft.world.entity.boss.enderdragon.h" +#include "net.minecraft.world.level.tile.h" +#include "EndPodiumFeature.h" + +EndPodiumFeature::EndPodiumFeature(int tile) +{ + this->tile = tile; + //m_iIndex=0; +} + +bool EndPodiumFeature::place(Level *level, Random *random, int x, int y, int z) +{ + // spawn Exit portal + int r = 4; + + for (int yy = y - 1; yy <= y + 32; yy++) + { + for (int xx = x - r; xx <= x + r; xx++) + { + for (int zz = z - r; zz <= z + r; zz++) + { + double xd = xx - x; + double zd = zz - z; + double d = sqrt(xd * xd + zd * zd); + if (d <= r - 0.5) + { + if (yy < y) + { + if (d > r - 1 - 0.5) + { + } + else + { + //level->setTile(xx, yy, zz, Tile::unbreakable_Id); + placeBlock(level, xx, yy, zz, Tile::unbreakable_Id, 0); + } + } + else if (yy > y) + { + //level->setTile(xx, yy, zz, 0); + placeBlock(level, xx, yy, zz, 0, 0); + } + else + { + if (d > r - 1 - 0.5) + { + //level->setTile(xx, yy, zz, Tile::unbreakable_Id); + placeBlock(level, xx, yy, zz, Tile::unbreakable_Id, 0); + } + } + } + } + } + } + + placeBlock(level,x, y + 0, z, Tile::unbreakable_Id, 0); + placeBlock(level,x, y + 1, z, Tile::unbreakable_Id, 0); + placeBlock(level,x, y + 2, z, Tile::unbreakable_Id, 0); + placeBlock(level,x - 1, y + 2, z, Tile::torch_Id, 0); + placeBlock(level,x + 1, y + 2, z, Tile::torch_Id, 0); + placeBlock(level,x, y + 2, z - 1, Tile::torch_Id, 0); + placeBlock(level,x, y + 2, z + 1, Tile::torch_Id, 0); + placeBlock(level,x, y + 3, z, Tile::unbreakable_Id, 0); + //placeBlock(level,x, y + 4, z, Tile::dragonEgg_Id, 0); + + // 4J-PB - The podium can be floating with nothing under it, so put some whiteStone under it if this is the case + for (int yy = y - 5; yy < y - 1; yy++) + { + for (int xx = x - (r - 1); xx <= x + (r - 1); xx++) + { + for (int zz = z - (r - 1); zz <= z + (r - 1); zz++) + { + if(level->isEmptyTile(xx,yy,zz)) + { + placeBlock(level, xx, yy, zz, Tile::whiteStone_Id, 0); + } + } + } + } + + + return true; +} + |
