Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Patch version 1.3.2 #149

Merged
merged 6 commits into from
Jul 10, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,15 @@ color: $biomes/colors.yml:SAKURA_MOUNTAINS

colors:
foliage: 0xffb7c5
grass: 0xB6DB61
water: 0x5DB7EF

features:
flora:
- GRASS
- PINK_PETALS
trees:
- DENSE_DARK_FOREST_TREES
- DENSE_SAKURA_TREES
landforms:
- MOSSY_BOULDERS
- SMALL_MOSSY_BOULDER_PATCHES
49 changes: 49 additions & 0 deletions features/vegetation/flowers/pink_petals.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
id: PINK_PETALS
type: FEATURE

distributor:
type: AND
distributors:
- type: SAMPLER
sampler:
type: POSITIVE_WHITE_NOISE
salt: 8172
threshold: 0.7
- type: SAMPLER
sampler:
type: PROBABILITY
sampler:
type: DOMAIN_WARP
amplitude: 5
warp:
type: GAUSSIAN
sampler:
type: OPEN_SIMPLEX_2
threshold: 0.5

locator:
type: AND
locators:
- type: TOP
range: &range
min: 62
max: 319
- type: PATTERN
range: *range
pattern:
type: MATCH_SET
blocks: $features/vegetation/meta.yml:plantable-blocks
offset: -1
- type: PATTERN
range: *range
pattern:
type: MATCH_SET
blocks:
- minecraft:snow
- minecraft:air
offset: 0

structures:
distribution:
type: CONSTANT
structures: pink_petals
36 changes: 36 additions & 0 deletions features/vegetation/trees/dense_sakura_trees.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
id: DENSE_SAKURA_TREES
type: FEATURE

distributor:
type: PADDED_GRID
width: 7
padding: 5
salt: 5972

locator:
type: AND
locators:
- type: TOP
range: &range
min: 64
max: 255
- type: PATTERN
range: *range
pattern:
type: MATCH_SET
blocks: $features/vegetation/meta.yml:plantable-blocks
offset: -1
- type: PATTERN
range: *range
pattern:
type: MATCH_SET
blocks:
- minecraft:snow
- minecraft:air
offset: 0

structures:
distribution:
type: CONSTANT
structures:
- sakura_tree_procedural: 1
2 changes: 1 addition & 1 deletion pack.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
id: OVERWORLD
version: 1.3.1
version: 1.4.0
author: "Astrash, Sancires, Aureus"

generator: NOISE_3D
Expand Down
16 changes: 16 additions & 0 deletions structures/vegetation/flowers/pink_petals.tesf
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
num flowers = randomInt(1000)/1000;
num dir = randomInt(10);
str blockID = "minecraft:pink_petals";

if(dir == 0) blockID = blockID + "[facing=north";
else if(dir == 1) blockID = blockID + "[facing=east";
else if(dir == 2) blockID = blockID + "[facing=west";
else if(dir == 3) blockID = blockID + "[facing=south";

if(flowers <= 0.5) blockID = blockID + ",flower_amount=4]";
else if(flowers <= 0.6) blockID = blockID + ",flower_amount=3]";
else if(flowers <= 0.8) blockID = blockID + ",flower_amount=2]";
else if(flowers <= 0.9) blockID = blockID + ",flower_amount=1]";

// Place flowers
block(0, 0, 0, blockID);
11 changes: 11 additions & 0 deletions structures/vegetation/trees/cherry_leaves_clump.tesf
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
block(0, 0, 0, "minecraft:cherry_leaves[distance=1,persistent=false]", false);

if (randomInt(4) == 0) {
block(0, 0, 1, "minecraft:cherry_leaves[distance=1,persistent=false]", false);
block(0, 1, 0, "minecraft:cherry_leaves[distance=1,persistent=false]", false);
block(0, 1, 1, "minecraft:cherry_leaves[distance=1,persistent=false]", false);
block(1, 0, 0, "minecraft:cherry_leaves[distance=1,persistent=false]", false);
block(1, 0, 1, "minecraft:cherry_leaves[distance=1,persistent=false]", false);
block(1, 1, 0, "minecraft:cherry_leaves[distance=1,persistent=false]", false);
block(1, 1, 1, "minecraft:cherry_leaves[distance=1,persistent=false]", false);
}
142 changes: 142 additions & 0 deletions structures/vegetation/trees/sakura_tree_procedural.tesf
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
num randPrecision = 100;
num goldenAngle = 2.39996;
num pi = 3.14159;
num twopi = 6.28318530718;

num trunkHeight = 4+randomInt(4);
str trunkBlock = "minecraft:cherry_log";

num sideBranchInterval = 3+randomInt(2);
num sideBranchMinHeight = 2+randomInt(3);
num sideBranchLengthMin = 3;
num sideBranchLengthVariation = 2;
num sideBranchVerticalVariation = 0;
num sideBranchVerticalDirection = 1+randomInt(randPrecision)/randPrecision/2;
num sideBranchLeafRadiusMin = 2;
num sideBranchLeafTranslate = 0;
num sideBranchLeafTopFlatness = 2;
num sideBranchLeafBottomFlatness = 4;
num sideBranchLeafDensity = 0.6;
str sideBranchLeafStructure = "cherry_leaves_clump";
str sideBranchBlockX = "minecraft:cherry_log[axis=x]";
str sideBranchBlockY = "minecraft:cherry_log[axis=y]";
str sideBranchBlockZ = "minecraft:cherry_log[axis=z]";

num topBranches = 10+randomInt(3);
num topBranchLengthUpwardsMin = 7+randomInt(3);
num topBranchLengthOutwardsMin = 4+randomInt(3);
num topBranchVerticalDirection = 0.4;
num topBranchLeafRadiusMin = 2;
num topBranchLeafTranslate = 0;
num topBranchLeafTopFlatness = 1.5;
num topBranchLeafBottomFlatness = 1;
num topBranchLeafDensity = 0.6;
str topBranchLeafStructure = "cherry_leaves_clump";
str topBranchBlockX = "minecraft:cherry_log[axis=x]";
str topBranchBlockY = "minecraft:cherry_log[axis=y]";
str topBranchBlockZ = "minecraft:cherry_log[axis=z]";

num branchAngle = randomInt(randPrecision)/randPrecision*2*pi;
for (num i = 0; i < trunkHeight; i = i + 1) {
if (i > sideBranchMinHeight) {
if (i % sideBranchInterval == 0) {
// Branch direction vector
num dx = sin(branchAngle);
num dy = sideBranchVerticalDirection + randomInt(randPrecision)/randPrecision*sideBranchVerticalVariation;
num dz = cos(branchAngle);
// Normalize vector
num mag = sqrt(pow(dx,2)+pow(dy,2)+pow(dz,2));
dx = dx/mag;
dy = dy/mag;
dz = dz/mag;
// Branch origin
num ox = 0;
num oy = i;
num oz = 0;
// Set branch block based on largest unsigned vector component
str branchBlock = sideBranchBlockY;
if (abs(dx) > max(abs(dy),abs(dz))) branchBlock = sideBranchBlockX;
else if (abs(dz) > max(abs(dy),abs(dx))) branchBlock = sideBranchBlockZ;
num branchLength = sideBranchLengthMin + randomInt(randPrecision)/randPrecision*sideBranchLengthVariation;
// Generate branch
for (num l = 1; l <= branchLength; l = l + 1) {
block(l*dx+ox, l*dy+oy, l*dz+oz, branchBlock);
}
// Rotate angle of next branch
branchAngle = branchAngle + goldenAngle;
// Generate leaf cluster at the end of the branch
num radius = sideBranchLeafRadiusMin;
num radiusSquared = pow(radius, 2);
// Leaf cluster origin (end of branch)
num lox = ox+branchLength*dx;
num loy = oy+branchLength*dy + sideBranchLeafTranslate;
num loz = oz+branchLength*dz;
for (num cx = ceil(-radius); cx <= ceil(radius); cx = cx + 1) {
for (num cy = ceil(-radius/sideBranchLeafBottomFlatness); cy <= ceil(radius/sideBranchLeafTopFlatness); cy = cy + 1) {
for (num cz = ceil(-radius); cz <= ceil(radius); cz = cz + 1) {
num squashFactor = sideBranchLeafBottomFlatness;
if (cy > 0) squashFactor = sideBranchLeafTopFlatness;
num distanceSquared = pow(cx,2)+pow(cy*squashFactor,2)+pow(cz,2);
if (distanceSquared<radiusSquared && randomInt(randPrecision) / randPrecision < sideBranchLeafDensity) {
structure(lox+cx, loy+cy, loz+cz, sideBranchLeafStructure, "NONE", "CW_90", "CCW_90", "CW_180");
}
}
}
}
}
}
block(0, i, 0, trunkBlock);
}

for (num b = 1; b <= topBranches; b = b + 1) {
num t = b/topBranches;
num ti = 1-t;
// Branch direction vector
num dx = sin(branchAngle) * t;
num dy = topBranchVerticalDirection;
num dz = cos(branchAngle) * t;
// Normalize vector
num mag = sqrt(pow(dx,2)+pow(dy,2)+pow(dz,2));
dx = dx/mag;
dy = dy/mag;
dz = dz/mag;
// Branch origin
num ox = 0;
num oy = trunkHeight;
num oz = 0;
// Set branch block based on largest unsigned vector component
str branchBlock = topBranchBlockY;
if (abs(dx) > max(abs(dy),abs(dz))) branchBlock = topBranchBlockX;
else if (abs(dz) > max(abs(dy),abs(dx))) branchBlock = topBranchBlockZ;
num branchLength = topBranchLengthUpwardsMin*ti + topBranchLengthOutwardsMin*t;
// Generate branch
for (num l = 0; l <= branchLength; l = l + 1) {
block(l*dx+ox, l*dy+oy, l*dz+oz, branchBlock);
}
// Rotate angle of next branch
branchAngle = branchAngle + goldenAngle;
// Generate leaf cluster at the end of the branch
num radius = topBranchLeafRadiusMin;
num radiusSquared = pow(radius, 2);
// Leaf cluster origin (end of branch)
num lox = ox+branchLength*dx;
num loy = oy+branchLength*dy + topBranchLeafTranslate;
num loz = oz+branchLength*dz;
for (num cx = ceil(-radius); cx <= ceil(radius); cx = cx + 1) {
for (num cy = ceil(-radius/topBranchLeafBottomFlatness); cy <= ceil(radius/topBranchLeafTopFlatness); cy = cy + 1) {
for (num cz = ceil(-radius); cz <= ceil(radius); cz = cz + 1) {
num squashFactor = topBranchLeafBottomFlatness;
if (cy > 0) squashFactor = topBranchLeafTopFlatness;
num distanceSquared = pow(cx,2)+pow(cy*squashFactor,2)+pow(cz,2);
if (distanceSquared < radiusSquared && randomInt(randPrecision)/randPrecision < topBranchLeafDensity) {
structure(lox+cx, loy+cy, loz+cz, topBranchLeafStructure, "NONE", "CW_90", "CCW_90", "CW_180");
}
}
}
}
}

num beeNestRoll = randomInt(30); // 1 in 30 chance
if (beeNestRoll == 0) {
structure(0, sideBranchMinHeight-1, 0, "bee_nest", "NONE");
}