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#include "net.minecraft.world.level.biome.h"
4
5
6AddMushroomIslandLayer::AddMushroomIslandLayer(__int64 seedMixup, shared_ptr<Layer> parent) : Layer(seedMixup)
7{
8 this->parent = parent;
9}
10
11intArray AddMushroomIslandLayer::getArea(int xo, int yo, int w, int h)
12{
13 int px = xo - 1;
14 int py = yo - 1;
15 int pw = w + 2;
16 int ph = h + 2;
17 intArray p = parent->getArea(px, py, pw, ph);
18
19 intArray result = IntCache::allocate(w * h);
20 for (int y = 0; y < h; y++)
21 {
22 for (int x = 0; x < w; x++)
23 {
24 int n1 = p[(x + 0) + (y + 0) * pw];
25 int n2 = p[(x + 2) + (y + 0) * pw];
26 int n3 = p[(x + 0) + (y + 2) * pw];
27 int n4 = p[(x + 2) + (y + 2) * pw];
28 int c = p[(x + 1) + (y + 1) * pw];
29 initRandom(x + xo, y + yo);
30 if (c == 0 && (n1 == 0 && n2 == 0 && n3 == 0 && n4 == 0) && nextRandom(100) == 0)
31 {
32 result[x + y * w] = Biome::mushroomIsland->id;
33 }
34 else
35 {
36 result[x + y * w] = c;
37 }
38 }
39 }
40 return result;
41}