If a block is placed on top of a sugarcane and the the sugar cane is given some bonemeal, the sugarcane grows on top of the block as see in the screenshot attached below.
Tested on PocketMine Public Dev Server.
IP: dev1.ams.pmmp.io

This code is written in such a dumb way it's hardly surprising. In fact it almost looks like it was designed to do this.
Most helpful comment
This code is written in such a dumb way it's hardly surprising. In fact it almost looks like it was designed to do this.