use of com.ferreusveritas.dynamictrees.blocks.BlockTrunkShell.ShellMuse in project DynamicTrees by DynamicTreesTeam.
the class WailaBranchHandler method getTreeVolume.
private float getTreeVolume(World world, BlockPos pos) {
IBlockState state = world.getBlockState(pos);
Block block = state.getBlock();
// Dereference proxy trunk shell block
if (block instanceof BlockTrunkShell) {
ShellMuse muse = ((BlockTrunkShell) block).getMuse(world, pos);
if (muse != null) {
state = muse.state;
block = state.getBlock();
pos = muse.pos;
}
}
if (block instanceof BlockBranch) {
BlockBranch branch = (BlockBranch) block;
// Analyze only part of the tree beyond the break point and calculate it's volume, then destroy the branches
NodeNetVolume volumeSum = new NodeNetVolume();
branch.analyse(state, world, pos, null, new MapSignal(volumeSum));
return volumeSum.getVolume() * ModConfigs.treeHarvestMultiplier;
}
return 0;
}
Aggregations