package net.glowstone.block.blocktype;

import net.glowstone.block.GlowBlock;
import org.bukkit.Material;
import org.bukkit.block.BlockFace;
import org.bukkit.inventory.ItemStack;

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

public class BlockTallGrass extends BlockNeedsAttached {
    private final Random random = new Random();

    @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;
    }
}

@@ -58,125 +58,401 @@
 one.
-block.GlowBlock;%0Aimport org.bukkit.Material;%0Aimport org.bukkit.block.BlockFace;%0Aimport org.bukkit.inventory.ItemStack
+EventFactory;%0Aimport net.glowstone.block.GlowBlock;%0Aimport net.glowstone.block.GlowBlockState;%0Aimport net.glowstone.entity.GlowPlayer;%0A%0Aimport org.bukkit.GrassSpecies;%0Aimport org.bukkit.Material;%0Aimport org.bukkit.block.BlockFace;%0Aimport org.bukkit.event.block.BlockGrowEvent;%0Aimport org.bukkit.inventory.ItemStack;%0Aimport org.bukkit.material.LongGrass;%0Aimport org.bukkit.material.MaterialData
 ;%0A%0Ai
@@ -615,17 +615,44 @@
 ttached 
-%7B
+implements IBlockGrowable %7B%0A
 %0A    pri
@@ -1232,11 +1232,1656 @@
 e;%0A    %7D
+%0A%0A    @Override%0A    public boolean isFertilizable(GlowBlock block) %7B%0A        final MaterialData data = block.getState().getData();%0A        if (data instanceof LongGrass) %7B%0A            if (((LongGrass) data).getSpecies() != GrassSpecies.DEAD) %7B%0A                return true;%0A            %7D%0A        %7D else %7B%0A            warnMaterialData(LongGrass.class, data);%0A        %7D%0A        return false;%0A    %7D%0A%0A    @Override%0A    public boolean canGrowWithChance(GlowBlock block) %7B%0A        return true;%0A    %7D%0A%0A    @Override%0A    public void grow(GlowPlayer player, GlowBlock block) %7B%0A        final MaterialData data = block.getState().getData();%0A        if (data instanceof LongGrass) %7B%0A            final GrassSpecies species = ((LongGrass) data).getSpecies();%0A            if (species.equals(GrassSpecies.NORMAL) %7C%7C species.equals(GrassSpecies.FERN_LIKE)) %7B%0A                final GlowBlockState blockState = block.getState();%0A                final GlowBlockState headBlockState = block.getRelative(BlockFace.UP).getState();%0A                blockState.setType(Material.DOUBLE_PLANT);%0A                blockState.setRawData((byte) (species.ordinal() + 1));%0A                headBlockState.setType(Material.DOUBLE_PLANT);%0A                headBlockState.setRawData((byte) 8);%0A                BlockGrowEvent growEvent = new BlockGrowEvent(block, blockState);%0A                EventFactory.callEvent(growEvent);%0A                if (!growEvent.isCancelled()) %7B%0A                    blockState.update(true);%0A                    headBlockState.update(true);%0A                %7D%0A            %7D%0A        %7D else %7B%0A            warnMaterialData(LongGrass.class, data);%0A        %7D%0A    %7D
 %0A%7D%0A

Modify BlockTallGrass