Skip to content

Commit 6a31040

Browse files
committed
mushroom shape fix
1 parent f76c9a7 commit 6a31040

File tree

3 files changed

+11
-7
lines changed

3 files changed

+11
-7
lines changed

src/main/java/com/ferreusveritas/dynamictreesplus/systems/mushroomlogic/shapekits/BellShape.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ protected void registerProperties() {
5454

5555
@Override
5656
public List<BlockPos> getShapeCluster(MushroomShapeConfiguration configuration, MushroomCapContext context){
57-
return placeRing(configuration, context, context.age(), ringAction.GET);
57+
return placeRing(configuration, context, ringAction.GET);
5858
}
5959

6060
@Override
@@ -69,12 +69,12 @@ public float getChanceToAge(MushroomShapeConfiguration configuration) {
6969

7070
@Override
7171
public void generateMushroomCap(MushroomShapeConfiguration configuration, MushroomCapContext context) {
72-
placeRing(configuration, context, Math.min(context.age(), configuration.get(MAX_CAP_AGE)), ringAction.PLACE);
72+
placeRing(configuration, context, ringAction.PLACE);
7373
}
7474

7575
@Override
7676
public void clearMushroomCap (MushroomShapeConfiguration configuration, MushroomCapContext context){
77-
placeRing(configuration, context, context.age(),ringAction.CLEAR);
77+
placeRing(configuration, context, ringAction.CLEAR);
7878
}
7979

8080
enum ringAction {
@@ -83,7 +83,7 @@ enum ringAction {
8383
GET
8484
}
8585

86-
private List<BlockPos> placeRing (MushroomShapeConfiguration configuration, MushroomCapContext context, int age, ringAction action){
86+
private List<BlockPos> placeRing (MushroomShapeConfiguration configuration, MushroomCapContext context, ringAction action){
8787
DynamicCapCenterBlock centerBlock = context.species().getCapProperties().getDynamicCapCenterBlock().orElse(null);
8888
List<BlockPos> ringPositions = new LinkedList<>();
8989
if (centerBlock == null) return ringPositions;
@@ -92,6 +92,7 @@ private List<BlockPos> placeRing (MushroomShapeConfiguration configuration, Mush
9292
int power = configuration.get(CURVE_POWER);
9393

9494
float fac = calculateFactor(configuration, context);
95+
int age = context.age();
9596

9697
int y = 0;
9798
int radius = 1;

src/main/java/com/ferreusveritas/dynamictreesplus/tree/HugeMushroomSpecies.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -377,9 +377,11 @@ public void generate(GenerationContext context) {
377377

378378
private void generateMushroomCap(GenerationContext context, HugeMushroomSpecies species, List<Pair<BlockPos, Integer>> capAges){
379379
LevelAccessor level = context.level();
380-
for (Pair<BlockPos, Integer> capAge : capAges){
381-
level.setBlock(capAge.getA(), capProperties.getDynamicCapState(true, capAge.getB()), 2);
382-
species.getMushroomShapeKit().generateMushroomCap(new MushroomCapContext(level, capAge.getA(), species, capAge.getB()));
380+
for (Pair<BlockPos, Integer> posAge : capAges){
381+
int age = Math.min(posAge.getB(), species.getMushroomShapeKit().getMaxCapAge());
382+
BlockPos centerPos = posAge.getA();
383+
level.setBlock(centerPos, capProperties.getDynamicCapState(true, age), 2);
384+
species.getMushroomShapeKit().generateMushroomCap(new MushroomCapContext(level, centerPos, species, age));
383385
}
384386
}
385387

src/main/resources/trees/dynamictreesplus/families/mushroom.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"stick": "air",
77
"generate_stripped_branch": false,
88
"max_branch_radius": 24,
9+
"max_signal_depth": 64,
910
"texture_overrides": {
1011
"branch": "block/mushroom_stem",
1112
"branch_top": "block/mushroom_block_inside"

0 commit comments

Comments
 (0)