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 "IntCache.h"
4#include "SwampRiversLayer.h"
5
6SwampRiversLayer::SwampRiversLayer(__int64 seed, shared_ptr<Layer> parent) : Layer(seed)
7{
8 this->parent = parent;
9}
10
11intArray SwampRiversLayer::getArea(int xo, int yo, int w, int h)
12{
13 intArray b = parent->getArea(xo - 1, yo - 1, w + 2, h + 2);
14
15 intArray result = IntCache::allocate(w * h);
16 for (int y = 0; y < h; y++)
17 {
18 for (int x = 0; x < w; x++)
19 {
20 initRandom(x + xo, y + yo);
21 int old = b[(x + 1) + (y + 1) * (w + 2)];
22 if ((old == Biome::swampland->id && nextRandom(6) == 0) || ((old == Biome::jungle->id || old == Biome::jungleHills->id) && nextRandom(8) == 0))
23 {
24 result[x + y * w] = Biome::river->id;
25 }
26 else
27 {
28 result[x + y * w] = old;
29 }
30 }
31 }
32
33 return result;
34}