mirror of
https://github.com/neoStudiosLCE/neoLegacy.git
synced 2026-06-09 17:12:57 +00:00
32 lines
727 B
C++
32 lines
727 B
C++
#include "stdafx.h"
|
|
#include "RareBiomeSpotLayer.h"
|
|
#include "IntCache.h"
|
|
#include "net.minecraft.world.level.biome.h"
|
|
|
|
RareBiomeSpotLayer::RareBiomeSpotLayer(int32_t seed, int64_t seedMixup, shared_ptr<Layer> parent) : Layer(seed,seedMixup)
|
|
{
|
|
this->parent = parent;
|
|
}
|
|
|
|
intArray RareBiomeSpotLayer::getArea(int xo, int yo, int w, int h)
|
|
{
|
|
intArray b = parent->getArea(xo, yo, w, h);
|
|
intArray result = IntCache::allocate(w * h);
|
|
|
|
for (int y = 0; y < h; y++)
|
|
{
|
|
for (int x = 0; x < w; x++)
|
|
{
|
|
initRandom(x + xo, y + yo);
|
|
int biomeId = b[x + y * w];
|
|
|
|
if (nextRandom(57) == 0 && biomeId == Biome::plains->id)
|
|
result[x + y * w] = biomeId + 128;
|
|
else
|
|
result[x + y * w] = biomeId;
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|