From b691c43c44ff180d10e7d4a9afc83b98551ff586 Mon Sep 17 00:00:00 2001 From: daoge_cmd <3523206925@qq.com> Date: Sun, 1 Mar 2026 12:16:08 +0800 Subject: Initial commit --- Minecraft.World/IslandLayer.cpp | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 Minecraft.World/IslandLayer.cpp (limited to 'Minecraft.World/IslandLayer.cpp') diff --git a/Minecraft.World/IslandLayer.cpp b/Minecraft.World/IslandLayer.cpp new file mode 100644 index 00000000..b502f384 --- /dev/null +++ b/Minecraft.World/IslandLayer.cpp @@ -0,0 +1,25 @@ +#include "stdafx.h" +#include "net.minecraft.world.level.newbiome.layer.h" + +IslandLayer::IslandLayer(__int64 seedMixup) : Layer(seedMixup) +{ +} + +intArray IslandLayer::getArea(int xo, int yo, int w, int h) +{ + intArray result = IntCache::allocate(w * h); + for (int y = 0; y < h; y++) + { + for (int x = 0; x < w; x++) + { + initRandom(xo + x, yo + y); + result[x + y * w] = (nextRandom(10) == 0) ? 1 : 0; + } + } + // if (0, 0) is located here, place an island + if (xo > -w && xo <= 0 && yo > -h && yo <= 0) + { + result[-xo + -yo * w] = 1; + } + return result; +} \ No newline at end of file -- cgit v1.2.3