Fix #1222 Fix #980 Refactor and improve tree generation

This commit is contained in:
mezz committed 2016-05-21 16:41:22 -07:00
1 parent 4fdbaff7ad
commit edacde02e7
63 files changed
+1395 -1199

No files matched your search

@@ -5,6 +5,9 @@
******************************************************************************/
package forestry.api.world;
import javax.annotation.Nullable;
import java.util.Random;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
@@ -19,7 +22,12 @@ public interface ITreeGenData {
float getHeightModifier();
boolean canGrow(World world, BlockPos pos, int expectedGirth, int expectedHeight);
/**
* @return Position that this tree can grow. May be different from pos if there are multiple saplings.
* Returns null if a sapling at the given position can not grow into a tree.
*/
@Nullable
BlockPos canGrow(World world, BlockPos pos, int expectedGirth, int expectedHeight);
boolean setLeaves(World world, GameProfile owner, BlockPos pos);
@@ -27,7 +35,7 @@ public interface ITreeGenData {
boolean allowsFruitBlocks();
boolean trySpawnFruitBlock(World world, BlockPos pos);
boolean trySpawnFruitBlock(World world, Random rand, BlockPos pos);
ITreeGenome getGenome();
}