package net.glowstone.block.blocktype;

import net.glowstone.EventFactory;
import net.glowstone.block.GlowBlock;
import net.glowstone.block.GlowBlockState;
import net.glowstone.entity.GlowPlayer;

import org.bukkit.GrassSpecies;
import org.bukkit.Material;
import org.bukkit.block.BlockFace;
import org.bukkit.event.block.BlockGrowEvent;
import org.bukkit.inventory.ItemStack;
import org.bukkit.material.LongGrass;
import org.bukkit.material.MaterialData;

import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;

public class BlockTallGrass extends BlockNeedsAttached implements IBlockGrowable {

    @Override
    public Collection<ItemStack> getDrops(GlowBlock block, ItemStack tool) {
        if (random.nextFloat() < .125) {
            return Collections.unmodifiableList(Arrays.asList(new ItemStack(Material.SEEDS, 1)));
        }
        return BlockDropless.EMPTY_STACK;
    }

    @Override
    public boolean canAbsorb(GlowBlock block, BlockFace face, ItemStack holding) {
        return true;
    }

    @Override
    public boolean canOverride(GlowBlock block, BlockFace face, ItemStack holding) {
        return true;
    }

    @Override
    public boolean isFertilizable(GlowBlock block) {
        final MaterialData data = block.getState().getData();
        if (data instanceof LongGrass) {
            if (((LongGrass) data).getSpecies() != GrassSpecies.DEAD) {
                return true;
            }
        } else {
            warnMaterialData(LongGrass.class, data);
        }
        return false;
    }

    @Override
    public boolean canGrowWithChance(GlowBlock block) {
        return true;
    }

    @Override
    public void grow(GlowPlayer player, GlowBlock block) {
        final MaterialData data = block.getState().getData();
        if (data instanceof LongGrass) {
            final GrassSpecies species = ((LongGrass) data).getSpecies();
            if (species == GrassSpecies.NORMAL || species == GrassSpecies.FERN_LIKE) {
                final GlowBlockState blockState = block.getState();
                final GlowBlockState headBlockState = block.getRelative(BlockFace.UP).getState();
                blockState.setType(Material.DOUBLE_PLANT);
                blockState.setRawData((byte) (species.ordinal() + 1));
                headBlockState.setType(Material.DOUBLE_PLANT);
                headBlockState.setRawData((byte) 8);
                BlockGrowEvent growEvent = new BlockGrowEvent(block, blockState);
                EventFactory.callEvent(growEvent);
                if (!growEvent.isCancelled()) {
                    blockState.update(true);
                    headBlockState.update(true);
                }
            }
        } else {
            warnMaterialData(LongGrass.class, data);
        }
    }
}

@@ -2026,17 +2026,21 @@
 ckState 
-b
+headB
 lockStat
@@ -2056,58 +2056,137 @@
 .get
-State();%0A                final GlowBlockState head
+Relative(BlockFace.UP).getState();%0A                if (headBlockState.getType() == Material.AIR) %7B%0A                    final Glow
 Bloc
@@ -2195,42 +2195,27 @@
 tate
- =
  block
-.getRelative(BlockFace.UP)
+State = block
 .get
@@ -2231,32 +2231,36 @@
                 
+    
 blockState.setTy
@@ -2278,32 +2278,36 @@
 .DOUBLE_PLANT);%0A
+    
                 
@@ -2369,32 +2369,36 @@
                 
+   
+ 
 headBlockState.s
@@ -2436,32 +2436,36 @@
                 
+    
 headBlockState.s
@@ -2501,16 +2501,20 @@
         
+ 
+   
 BlockGro
@@ -2587,16 +2587,20 @@
         
+   
+ 
 EventFac
@@ -2638,24 +2638,28 @@
             
+    
 if (!growEve
@@ -2690,32 +2690,36 @@
                 
+ 
+   
 blockState.updat
@@ -2739,32 +2739,36 @@
                 
+   
+ 
 headBlockState.u
@@ -2772,32 +2772,54 @@
 e.update(true);%0A
+                    %7D%0A
                 

Check above block is air when growing tall grass