the game where you go into mines and start crafting! but for consoles (forked directly from smartcmd's github)
at main 61 lines 1.6 kB view raw
1#include "stdafx.h" 2#include "net.minecraft.world.level.newbiome.layer.h" 3#include "System.h" 4 5SmoothZoomLayer::SmoothZoomLayer(__int64 seedMixup, shared_ptr<Layer>parent) : Layer(seedMixup) 6{ 7 this->parent = parent; 8} 9 10intArray SmoothZoomLayer::getArea(int xo, int yo, int w, int h) 11{ 12 int px = xo >> 1; 13 int py = yo >> 1; 14 int pw = (w >> 1) + 3; 15 int ph = (h >> 1) + 3; 16 intArray p = parent->getArea(px, py, pw, ph); 17 18 intArray tmp = IntCache::allocate((pw * 2) * (ph * 2)); 19 int ww = (pw << 1); 20 for (int y = 0; y < ph - 1; y++) 21 { 22 int ry = y << 1; 23 int pp = ry * ww; 24 int ul = p[(0 + 0) + (y + 0) * pw]; 25 int dl = p[(0 + 0) + (y + 1) * pw]; 26 for (int x = 0; x < pw - 1; x++) 27 { 28 initRandom((x + px) << 1, (y + py) << 1); 29 30 int ur = p[(x + 1) + (y + 0) * pw]; 31 int dr = p[(x + 1) + (y + 1) * pw]; 32 33 tmp[pp] = ul; 34 tmp[pp++ + ww] = ul + (dl - ul) * (nextRandom(256)) / 256; 35 tmp[pp] = ul + (ur - ul) * (nextRandom(256)) / 256; 36 37 int a = ul + (ur - ul) * (nextRandom(256)) / 256; 38 int b = dl + (dr - dl) * (nextRandom(256)) / 256; 39 tmp[pp++ + ww] = a + (b - a) * (nextRandom(256)) / 256; 40 41 ul = ur; 42 dl = dr; 43 } 44 } 45 intArray result = IntCache::allocate(w * h); 46 for (int y = 0; y < h; y++) 47 { 48 System::arraycopy(tmp, (y + (yo & 1)) * (pw << 1) + (xo & 1), &result, y * w, w); 49 } 50 return result; 51} 52 53shared_ptr<Layer>SmoothZoomLayer::zoom(__int64 seed, shared_ptr<Layer>sup, int count) 54{ 55 shared_ptr<Layer>result = sup; 56 for (int i = 0; i < count; i++) 57 { 58 result = shared_ptr<Layer>(new SmoothZoomLayer(seed + i, result)); 59 } 60 return result; 61}