the game where you go into mines and start crafting! but for consoles (forked directly from smartcmd's github)
at master 42 lines 1.1 kB view raw
1#include "stdafx.h" 2#include "net.minecraft.world.level.newbiome.layer.h" 3#include "net.minecraft.world.level.biome.h" 4 5 6GrowMushroomIslandLayer::GrowMushroomIslandLayer(__int64 seedMixup, shared_ptr<Layer> parent) : Layer(seedMixup) 7{ 8 this->parent = parent; 9} 10 11intArray GrowMushroomIslandLayer::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 29 int c = p[(x + 1) + (y + 1) * pw]; 30 31 if( ( n1 == Biome::mushroomIsland->id ) || ( n2 == Biome::mushroomIsland->id ) || ( n3 == Biome::mushroomIsland->id ) || ( n4 == Biome::mushroomIsland->id ) ) 32 { 33 result[x + y * w] = Biome::mushroomIsland->id; 34 } 35 else 36 { 37 result[x + y * w] = c; 38 } 39 } 40 } 41 return result; 42}