mirror of
https://git.neolegacy.dev/neoStudiosLCE/neoLegacy.git
synced 2026-11-19 12:04:15 +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
31 lines
761 B
C++
31 lines
761 B
C++
#include "stdafx.h"
|
|
#include "net.minecraft.world.level.h"
|
|
#include "net.minecraft.world.level.tile.h"
|
|
#include "EndGatewayFeature.h"
|
|
|
|
bool EndGatewayFeature::place(Level *level, Random *random, int x, int y, int z)
|
|
{
|
|
for (int xx = x - 1; xx <= x + 1; xx++)
|
|
{
|
|
for (int zz = z - 1; zz <= z + 1; zz++)
|
|
{
|
|
for (int yy = y - 2; yy <= y + 2; yy++)
|
|
{
|
|
bool atX = xx == x;
|
|
bool atY = yy == y;
|
|
bool atZ = zz == z;
|
|
bool edgeY = abs(yy - y) == 2;
|
|
|
|
int tile = Tile::bedrock_Id;
|
|
if (atX && atY && atZ) tile = Tile::end_gateway_Id;
|
|
else if (atY) tile = 0;
|
|
else if (edgeY && atX && atZ) tile = Tile::bedrock_Id;
|
|
else if ((!atX && !atZ) || edgeY) tile = 0;
|
|
|
|
placeBlock(level, xx, yy, zz, tile, 0);
|
|
}
|
|
}
|
|
}
|
|
return true;
|
|
}
|