the game where you go into mines and start crafting! but for consoles (forked directly from smartcmd's github)
1#include "stdafx.h"
2#include "net.minecraft.world.level.biome.h"
3#include "net.minecraft.world.level.newbiome.layer.h"
4
5RiverMixerLayer::RiverMixerLayer(__int64 seed, shared_ptr<Layer>biomes, shared_ptr<Layer>rivers) : Layer(seed)
6{
7 this->biomes = biomes;
8 this->rivers = rivers;
9}
10
11void RiverMixerLayer::init(__int64 seed)
12{
13 biomes->init(seed);
14 rivers->init(seed);
15 Layer::init(seed);
16}
17
18intArray RiverMixerLayer::getArea(int xo, int yo, int w, int h)
19{
20 intArray b = biomes->getArea(xo, yo, w, h);
21 intArray r = rivers->getArea(xo, yo, w, h);
22
23 intArray result = IntCache::allocate(w * h);
24 for (int i = 0; i < w * h; i++)
25 {
26 if (b[i] == Biome::ocean->id)
27 {
28 result[i] = b[i];
29
30 }
31 else
32 {
33 if (r[i] >= 0)
34 {
35 if (b[i] == Biome::iceFlats->id) result[i] = Biome::frozenRiver->id;
36 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)
37 else result[i] = r[i];
38 }
39 else
40 {
41 result[i] = b[i];
42 }
43 }
44 }
45
46 return result;
47}