TreeHelper.getExactSpecies seem to not working for trees more than 1 block in diameter
Prunoideae opened this issue ยท 1 comments
Describe the bug
I have a modified Thermal Expansion for have it integrated with the DT, but it seems that the function doesn't functioning if the tree is more than 1 block, as the code always report the species as Species.NULLSPECIES.
At first I guess it's because the tree species registered from addons made the check wrong, but it seems that it actually doesn't.
I didn't have the DT modified, it's the newest version on CurseForge.
To Reproduce
Steps to reproduce the behavior:
This is my code for checking valid trees, sorry for I'm not publishing it on Github since I'm quite lazy and the modpack is still on heavy developing.
Screenshots
Using it on a single block tree and the result (Vanilla Spruce Tree):
Using this on a multi block based tree and the result is not found (BOP's Fir Tree):
Mods List
Forge 14.23.5.2847
DynamicTrees 0.9.7
Thermal Expansion - Own modified version
I tested the mod in a separate instance so this is all the mods present.
Thick trunk were still fairly new when I last worked on them and the getExactSpecies function never really accounted for them properly. Consider adding this wrapper function to your codebase to work around the problem until I modify the DT codebase.
public static Species getExactSpeciesCustom(IBlockState blockstate, World world, BlockPos pos) {
if(blockstate.getBlock() instanceof BlockTrunkShell) {
BlockTrunkShell trunkShell = (BlockTrunkShell)blockstate.getBlock();
ShellMuse muse = trunkShell.getMuse(world, pos);
return getExactSpecies(muse.state, world, muse.pos);
}
return getExactSpecies(blockstate, world, pos);
}
Hope this helps.