Skip to content

Commit 65cd36d

Browse files
committed
made getBranchForPlacement be used for growth too
1 parent 43e687a commit 65cd36d

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
modName=DynamicTrees
22
modId=dynamictrees
3-
modVersion=0.10.0-Beta33.1
3+
modVersion=0.10.0-Beta33.2
44
group=com.ferreusveritas.dynamictrees
55

66
mcVersion=1.16.5

src/main/java/com/ferreusveritas/dynamictrees/blocks/leaves/DynamicLeavesBlock.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -527,10 +527,11 @@ public boolean needLeaves(World world, BlockPos pos, LeavesProperties leavesProp
527527

528528
public GrowSignal branchOut(World world, BlockPos pos, GrowSignal signal) {
529529

530-
LeavesProperties leavesProperties = signal.getSpecies().getLeavesProperties();
530+
Species species = signal.getSpecies();
531+
LeavesProperties leavesProperties = species.getLeavesProperties();
531532

532533
//Check to be sure the placement for a branch is valid by testing to see if it would first support a leaves block
533-
if (!needLeaves(world, pos, leavesProperties, signal.getSpecies())) {
534+
if (!needLeaves(world, pos, leavesProperties, species)) {
534535
signal.success = false;
535536
return signal;
536537
}
@@ -544,16 +545,16 @@ public GrowSignal branchOut(World world, BlockPos pos, GrowSignal signal) {
544545
boolean hasLeaves = false;
545546

546547
for (Direction dir : Direction.values()) {
547-
if (needLeaves(world, pos.relative(dir), leavesProperties, signal.getSpecies())) {
548+
if (needLeaves(world, pos.relative(dir), leavesProperties, species)) {
548549
hasLeaves = true;
549550
break;
550551
}
551552
}
552553

553554
if (hasLeaves) {
554555
//Finally set the leaves block to a branch
555-
Family family = signal.getSpecies().getFamily();
556-
family.getBranch().ifPresent(branch ->
556+
Family family = species.getFamily();
557+
family.getBranchForPlacement(world, species, pos).ifPresent(branch ->
557558
branch.setRadius(world, pos, family.getPrimaryThickness(), null)
558559
);
559560
signal.radius = family.getSecondaryThickness();//For the benefit of the parent branch

0 commit comments

Comments
 (0)