the game where you go into mines and start crafting! but for consoles (forked directly from smartcmd's github)
at main 74 lines 2.3 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 5ShoreLayer::ShoreLayer(__int64 seed, shared_ptr<Layer> parent) : Layer(seed) 6{ 7 this->parent = parent; 8} 9 10intArray ShoreLayer::getArea(int xo, int yo, int w, int h) 11{ 12 intArray b = parent->getArea(xo - 1, yo - 1, w + 2, h + 2); 13 14 intArray result = IntCache::allocate(w * h); 15 for (int y = 0; y < h; y++) 16 { 17 for (int x = 0; x < w; x++) 18 { 19 initRandom(x + xo, y + yo); 20 int old = b[(x + 1) + (y + 1) * (w + 2)]; 21 if (old == Biome::mushroomIsland->id) 22 { 23 int _n = b[(x + 1) + (y + 1 - 1) * (w + 2)]; 24 int _e = b[(x + 1 + 1) + (y + 1) * (w + 2)]; 25 int _w = b[(x + 1 - 1) + (y + 1) * (w + 2)]; 26 int _s = b[(x + 1) + (y + 1 + 1) * (w + 2)]; 27 if (_n == Biome::ocean->id || _e == Biome::ocean->id || _w == Biome::ocean->id || _s == Biome::ocean->id) 28 { 29 result[x + y * w] = Biome::mushroomIslandShore->id; 30 } 31 else 32 { 33 result[x + y * w] = old; 34 } 35 } 36 else if (old != Biome::ocean->id && old != Biome::river->id && old != Biome::swampland->id && old != Biome::extremeHills->id) 37 { 38 int _n = b[(x + 1) + (y + 1 - 1) * (w + 2)]; 39 int _e = b[(x + 1 + 1) + (y + 1) * (w + 2)]; 40 int _w = b[(x + 1 - 1) + (y + 1) * (w + 2)]; 41 int _s = b[(x + 1) + (y + 1 + 1) * (w + 2)]; 42 if (_n == Biome::ocean->id || _e == Biome::ocean->id || _w == Biome::ocean->id || _s == Biome::ocean->id) 43 { 44 result[x + y * w] = Biome::beaches->id; 45 } 46 else 47 { 48 result[x + y * w] = old; 49 } 50 } 51 else if (old == Biome::extremeHills->id) 52 { 53 int _n = b[(x + 1) + (y + 1 - 1) * (w + 2)]; 54 int _e = b[(x + 1 + 1) + (y + 1) * (w + 2)]; 55 int _w = b[(x + 1 - 1) + (y + 1) * (w + 2)]; 56 int _s = b[(x + 1) + (y + 1 + 1) * (w + 2)]; 57 if (_n != Biome::extremeHills->id || _e != Biome::extremeHills->id || _w != Biome::extremeHills->id || _s != Biome::extremeHills->id) 58 { 59 result[x + y * w] = Biome::smallerExtremeHills->id; 60 } 61 else 62 { 63 result[x + y * w] = old; 64 } 65 } 66 else 67 { 68 result[x + y * w] = old; 69 } 70 } 71 } 72 73 return result; 74}