aboutsummaryrefslogtreecommitdiff
path: root/Minecraft.World/FlatLayer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Minecraft.World/FlatLayer.cpp')
-rw-r--r--Minecraft.World/FlatLayer.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/Minecraft.World/FlatLayer.cpp b/Minecraft.World/FlatLayer.cpp
new file mode 100644
index 00000000..3d19dc4d
--- /dev/null
+++ b/Minecraft.World/FlatLayer.cpp
@@ -0,0 +1,20 @@
+#include "stdafx.h"
+#include "net.minecraft.world.level.newbiome.layer.h"
+
+FlatLayer::FlatLayer(int val) : Layer(0)
+{
+ this->val = val;
+}
+
+intArray FlatLayer::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++)
+ {
+ result[x + y * w] = val;
+ }
+ }
+ return result;
+} \ No newline at end of file