mirror of
https://git.neolegacy.dev/neoStudiosLCE/neoLegacy.git
synced 2026-11-19 03:53:03 +01:00
Co-authored-by: DrPerkyLegit <116128211+DrPerkyLegit@users.noreply.github.com> Co-authored-by: github-actions <github-actions@github.com> Co-authored-by: Anaël <60509176+Bakoubak@users.noreply.github.com> Reviewed-on: https://git.neolegacy.dev/neoStudiosLCE/neoLegacy/pulls/4205
24 lines
775 B
C++
24 lines
775 B
C++
#include "stdafx.h"
|
|
#include "net.minecraft.world.level.h"
|
|
#include "net.minecraft.world.level.tile.h"
|
|
#include "EndIslandFeature.h"
|
|
|
|
bool EndIslandFeature::place(Level *level, Random *random, int x, int y, int z)
|
|
{
|
|
float radius = static_cast<float>(random->nextInt(3)) + 4.0f;
|
|
for (int yy = 0; radius > 0.5f; radius -= static_cast<float>(random->nextInt(2)) + 0.5f, --yy)
|
|
{
|
|
for (int xx = static_cast<int>(floorf(-radius)); xx <= static_cast<int>(ceilf(radius)); ++xx)
|
|
{
|
|
for (int zz = static_cast<int>(floorf(-radius)); zz <= static_cast<int>(ceilf(radius)); ++zz)
|
|
{
|
|
if (static_cast<float>(xx * xx + zz * zz) <= (radius + 1.0f) * (radius + 1.0f))
|
|
{
|
|
placeBlock(level, x + xx, y + yy, z + zz, Tile::end_stone_Id, 0);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return true;
|
|
}
|