Skip to content

Commit 51b3aed

Browse files
committed
Add honey combs to large bee nests
1 parent e1866e5 commit 51b3aed

2 files changed

Lines changed: 50 additions & 1 deletion

File tree

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
num randPrecision = 100;
2+
num radius = 1 + randomInt(randPrecision) / randPrecision / 2;
3+
num warp = 2;
4+
num warpFreq = 2;
5+
num squish = 0.6;
6+
num radiusSquared = pow(radius, 2);
7+
num yTranslate = 0;
8+
9+
bool valid = false;
10+
11+
for (num i = 0; i < 10; i = i + 1) {
12+
if (getBlock(0, i + 1, 0) == "minecraft:bee_nest") {
13+
valid = true;
14+
yTranslate = i;
15+
break;
16+
}
17+
}
18+
19+
if (!valid) fail;
20+
21+
for (num x = -radius - warp; x < radius + warp; x = x + 1) {
22+
for (num y = (-radius - warp) / squish; y < (radius + warp) / squish; y = y + 1) {
23+
for (num z = -radius - warp; z < radius + warp; z = z + 1) {
24+
num warpX = warp * sampler("simplex3",
25+
warpFreq * (x + originX()),
26+
warpFreq * (y + originY() + 1000),
27+
warpFreq * (z + originZ()));
28+
num warpY = warp * sampler("simplex3",
29+
warpFreq * (x + originX()),
30+
warpFreq * (y + originY() + 2000),
31+
warpFreq * (z + originZ()));
32+
num warpZ = warp * sampler("simplex3",
33+
warpFreq * (x + originX()),
34+
warpFreq * (y + originY() + 3000),
35+
warpFreq * (z + originZ()));
36+
if (pow(x + warpX, 2) + pow((y + warpY) * squish, 2) + pow(z + warpZ, 2) < radiusSquared) {
37+
block(x, y + yTranslate, z, "minecraft:honeycomb_block", false);
38+
}
39+
}
40+
}
41+
}

structures/misc/bee-nest/large_bee_nest.tesf

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,12 @@ entity(0, yTranslate + 10, 0, "minecraft:bee");
4545
entity(0, yTranslate + 10, 0, "minecraft:bee");
4646

4747

48-
print("Generating at " + originX() + " " + originY() + " " + originZ());
48+
structure(3-randomInt(7), 15, 3-randomInt(7), "honey_comb", "NONE");
49+
structure(3-randomInt(7), 15, 3-randomInt(7), "honey_comb", "NONE");
50+
structure(3-randomInt(7), 15, 3-randomInt(7), "honey_comb", "NONE");
51+
structure(3-randomInt(7), 15, 3-randomInt(7), "honey_comb", "NONE");
52+
structure(3-randomInt(7), 15, 3-randomInt(7), "honey_comb", "NONE");
53+
structure(3-randomInt(7), 15, 3-randomInt(7), "honey_comb", "NONE");
54+
structure(3-randomInt(7), 15, 3-randomInt(7), "honey_comb", "NONE");
55+
56+
//print("Generating at " + originX() + " " + originY() + " " + originZ());

0 commit comments

Comments
 (0)