content: package thebetweenlands.common.block.terrain;
  
  import net.minecraft.block.SoundType;
  import net.minecraft.block.material.Material;
  import net.minecraft.block.state.IBlockState;
  import net.minecraft.util.EnumFacing;
  import net.minecraft.util.math.BlockPos;
  import net.minecraft.world.IBlockAccess;
  import net.minecraftforge.common.EnumPlantType;
  import net.minecraftforge.common.IPlantable;
  import thebetweenlands.common.block.BasicBlock;
  
  public class BlockGiantRoot extends BasicBlock {
  	public BlockGiantRoot() {
  		super(Material.WOOD);
  		this.setHarvestLevel2("axe", 0).setSoundType2(SoundType.WOOD).setHardness(2.0F);
  	}
  
  	@Override
  	public boolean canSustainLeaves(IBlockState state, IBlockAccess world, BlockPos pos) {
  		return true;
  	}
  
  	@Override
  	public boolean canSustainPlant(IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing direction, IPlantable plantable) {
  		if(super.canSustainPlant(state, world, pos, direction, plantable)) {
  			return true;
  		}
  
  		EnumPlantType plantType = plantable.getPlantType(world, pos.offset(direction));
  
  		switch(plantType) {
  		case Beach:
  			boolean hasWater = (world.getBlockState(pos.east()).getMaterial() == Material.WATER ||
  			world.getBlockState(pos.west()).getMaterial() == Material.WATER ||
  			world.getBlockState(pos.north()).getMaterial() == Material.WATER ||
  			world.getBlockState(pos.south()).getMaterial() == Material.WATER);
  			return hasWater;
  		case Plains:
  			return true;
  		default:
  			return false;
  		}
  	}
  }
  