neoLegacy/Minecraft.World/RareBiomeSpotLayer.cpp
Lord_Cambion 0e4c5ef463 fix: matching constructors to wii u
i noticed constructor are different. still nothing changed :(
2026-05-19 17:07:26 +02:00

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;
}