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.newbiome.layer.h"
3
4SmoothLayer::SmoothLayer(__int64 seedMixup, shared_ptr<Layer>parent) : Layer(seedMixup)
5{
6 this->parent = parent;
7}
8
9intArray SmoothLayer::getArea(int xo, int yo, int w, int h)
10{
11 int px = xo - 1;
12 int py = yo - 1;
13 int pw = w + 2;
14 int ph = h + 2;
15 intArray p = parent->getArea(px, py, pw, ph);
16
17 intArray result = IntCache::allocate(w * h);
18 for (int y = 0; y < h; y++)
19 {
20 for (int x = 0; x < w; x++)
21 {
22 int l = p[(x + 0) + (y + 1) * pw];
23 int r = p[(x + 2) + (y + 1) * pw];
24 int u = p[(x + 1) + (y + 0) * pw];
25 int d = p[(x + 1) + (y + 2) * pw];
26 int c = p[(x + 1) + (y + 1) * pw];
27 if (l == r && u == d)
28 {
29 initRandom((x + xo), (y + yo));
30 if (nextRandom(2) == 0) c = l;
31 else c = u;
32
33 }
34 else
35 {
36 if (l == r) c = l;
37 if (u == d) c = u;
38 }
39 result[x + y * w] = c;
40
41 }
42 }
43
44 return result;
45}