use of com.ferreusveritas.dynamictrees.api.cells.ICell in project DynamicTrees by DynamicTreesTeam.
the class BlockDynamicLeaves method getHydrationLevelFromNeighbors.
/**
* Gathers hydration levels from neighbors before pushing the values into the solver
*/
public int getHydrationLevelFromNeighbors(IBlockAccess access, BlockPos pos, ILeavesProperties leavesProp) {
ICell[] cells = new ICell[6];
for (EnumFacing dir : EnumFacing.VALUES) {
BlockPos deltaPos = pos.offset(dir);
IBlockState state = access.getBlockState(deltaPos);
ITreePart part = TreeHelper.getTreePart(state);
cells[dir.ordinal()] = part.getHydrationCell(access, deltaPos, state, dir, leavesProp);
}
// Find center cell's value from neighbors
return leavesProp.getCellKit().getCellSolver().solve(cells);
}
Aggregations