Skip to content

Commit

Permalink
fixed crashes in latest version
Browse files Browse the repository at this point in the history
  • Loading branch information
supermassimo committed May 1, 2023
1 parent 502e4db commit f2c7d37
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 36 deletions.
6 changes: 3 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
modName=DynamicTreesBOP
modId=dtbop
modVersion=3.0.0-Beta3
modVersion=3.0.0-Beta4
group=therealeststu.dtbop

mcVersion=1.18.2
forgeVersion=40.1.84
mappingsVersion=2022.09.04

dynamicTreesVersion=0.11.0-Beta6
dynamicTreesPlusVersion=0.1.0-Beta2
dynamicTreesVersion=0.11.0-Beta10.1
dynamicTreesPlusVersion=0.2.0-Beta4
jeiVersion=9.7.1.255
ccVersion=1.100.10
suggestionProviderFixVersion=1.0.0
Expand Down
35 changes: 4 additions & 31 deletions src/main/java/therealeststu/dtbop/tree/CypressSpecies.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,7 @@ public boolean isAcceptableSoilForWorldgen(LevelAccessor level, BlockPos pos, Bl
}

@Override
public BlockPos preGeneration(LevelAccessor level, BlockPos rootPosition, int radius, Direction facing, SafeChunkBounds safeBounds, JoCode joCode) {
BlockPos root = rootPosition;
public BlockPos preGeneration(LevelAccessor level, BlockPos.MutableBlockPos rootPosition, int radius, Direction facing, SafeChunkBounds safeBounds, JoCode joCode) {
if (this.isWater(level.getBlockState(rootPosition))) {
int i = 1;
for (; i <= maxDepth; i++) {
Expand All @@ -53,39 +52,13 @@ public BlockPos preGeneration(LevelAccessor level, BlockPos rootPosition, int ra
if (!isWater(downState) && isAcceptableSoilUnderWater(downState))
break;
}
root = root.below(i);
rootPosition.move(Direction.DOWN, i);
}
return super.preGeneration(level, root, radius, facing, safeBounds, joCode);
return super.preGeneration(level, rootPosition, radius, facing, safeBounds, joCode);
}

public boolean isAcceptableSoilUnderWater(BlockState soilBlockState) {
return SoilHelper.isSoilAcceptable(soilBlockState, this.soilTypeFlags | SoilHelper.getSoilFlags("sand_like", "mud_like"), true);
return SoilHelper.isSoilAcceptable(soilBlockState, this.soilTypeFlags | SoilHelper.getSoilFlags("sand_like", "mud_like"));
}

// @Override
// public boolean placeRootyDirtBlock(IWorld world, BlockPos rootPos, int fertility) {
// if (this.isWater(world.getBlockState(rootPos)))
// return world.setBlock(rootPos, (DTBOPRegistries.largeRootyWater.defaultBlockState().setValue(RootyBlock.FERTILITY, fertility)).setValue(RootyBlock.IS_VARIANT, this.doesRequireTileEntity(world, rootPos)), 3);
// else
// return super.placeRootyDirtBlock(world, rootPos, fertility);
// }

// @Override
// public boolean postGrow(World world, BlockPos rootPos, BlockPos treePos, int fertility, boolean natural) {
// if (world.getBlockState(rootPos).getBlock() == RootyBlockHelper.getRootyBlock(Blocks.WATER)){
// if (TreeHelper.isBranch(world.getBlockState(rootPos.above()))){
// int radius = TreeHelper.getRadius(world, rootPos.above());
// if (radius >= 8){
// TileEntity rootTE = world.getBlockEntity(rootPos);
// world.setBlockAndUpdate(rootPos, DTBOPRegistries.largeRootyWater.defaultBlockState()
// .setValue(RootyBlock.FERTILITY, fertility)
// .setValue(RootyBlock.IS_VARIANT, world.getBlockState(rootPos).getValue(RootyBlock.IS_VARIANT)));
// if (rootTE != null)
// world.setBlockEntity(rootPos, rootTE);
// }
// }
// }
// return super.postGrow(world, rootPos, treePos, fertility, natural);
// }

}
2 changes: 1 addition & 1 deletion src/main/java/therealeststu/dtbop/tree/TwigletSpecies.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public TwigletSpecies(ResourceLocation name, Family family, LeavesProperties lea
}

@Override
protected void processVolume(NetVolumeNode.Volume volume) {
public void processVolume(NetVolumeNode.Volume volume) {
volume.addVolume(NetVolumeNode.Volume.VOXELSPERLOG);
super.processVolume(volume);
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/trees/dtbop/species/cypress_willow.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"dry": 0.5
},
"perfect_biomes": { "types": [ "swamp", "overworld" ] },
"acceptable_soils": [ "water_like", "dirt_like" ],
"acceptable_soils": [ "water_like", "dirt_like", "mud_like" ],
"features": [
{
"name": "vines",
Expand Down

0 comments on commit f2c7d37

Please sign in to comment.