mirror of
https://github.com/neoStudiosLCE/neoLegacy.git
synced 2026-05-21 21:49:46 +00:00
biomes like extreme hills now have correct blocks sky and water, also correct grass. another thing is that now in the world spawns mutated biomes and it is acceptable as a world generation. i dont thjink it is the same because seeds are not giving me the ones from youtube videos but we will work on it later. For now it works and it is acceptable. spawns a variety of biomes that before was spawned in a random way, now depending on next biomes and temperature
49 lines
1.4 KiB
C++
49 lines
1.4 KiB
C++
#include "stdafx.h"
|
|
#include "net.minecraft.world.level.biome.h"
|
|
#include "net.minecraft.world.level.newbiome.layer.h"
|
|
|
|
RiverMixerLayer::RiverMixerLayer(int64_t seed, shared_ptr<Layer> biomes, shared_ptr<Layer> rivers, int64_t seedMixup) : Layer(seedMixup)
|
|
{
|
|
this->biomes = biomes;
|
|
this->rivers = rivers;
|
|
}
|
|
|
|
void RiverMixerLayer::init(int64_t seed)
|
|
{
|
|
biomes->init(seed);
|
|
rivers->init(seed);
|
|
Layer::init(seed);
|
|
}
|
|
|
|
intArray RiverMixerLayer::getArea(int xo, int yo, int w, int h)
|
|
{
|
|
intArray b = biomes->getArea(xo, yo, w, h);
|
|
intArray r = rivers->getArea(xo, yo, w, h);
|
|
|
|
intArray result = IntCache::allocate(w * h);
|
|
for (int i = 0; i < w * h; i++)
|
|
{
|
|
if (b[i] == Biome::ocean->id || b[i] == Biome::deepOcean->id || b[i] == Biome::frozenOcean->id)
|
|
{
|
|
result[i] = b[i];
|
|
}
|
|
else
|
|
{
|
|
if (r[i] >= 0)
|
|
{
|
|
if (b[i] == Biome::iceFlats->id || b[i] == Biome::iceSpikes->id || b[i] == Biome::coldTaiga->id || b[i] == Biome::coldTaigaHills->id)
|
|
result[i] = Biome::frozenRiver->id;
|
|
else if (b[i] == Biome::mushroomIsland->id || b[i] == Biome::mushroomIslandShore->id)
|
|
result[i] = Biome::mushroomIsland->id; // 4J - don't make mushroom island shores as we don't have any island left once we do this as our islands are small (this used to change to mushroomIslandShore)
|
|
else
|
|
result[i] = r[i];
|
|
}
|
|
else
|
|
{
|
|
result[i] = b[i];
|
|
}
|
|
}
|
|
}
|
|
|
|
return result;
|
|
} |