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