package net.glowstone.block.blocktype;

import net.glowstone.block.GlowBlock;
import net.glowstone.block.entity.TEContainer;
import net.glowstone.block.entity.TileEntity;
import net.glowstone.entity.GlowPlayer;
import org.bukkit.block.BlockFace;
import org.bukkit.util.Vector;

/**
 * Base BlockType for containers.
 */
public class BlockContainer extends BlockType {

    @Override
    public boolean blockInteract(GlowPlayer player, GlowBlock block, BlockFace face, Vector clickedLoc) {
        TileEntity te = block.getTileEntity();
        if (te instanceof TEContainer) {
            // todo: animation?
            player.openInventory(((TEContainer) te).getInventory());
            return true;
        }
        return false;
    }

}

@@ -261,19 +261,117 @@
 kit.
-util.Vector
+inventory.ItemStack;%0Aimport org.bukkit.util.Vector;%0A%0Aimport java.util.Collection;%0Aimport java.util.LinkedList
 ;%0A%0A/
@@ -804,16 +804,16 @@
       %7D%0A
-
         
@@ -833,10 +833,413 @@
 %0A    %7D%0A%0A
+    @Override%0A    public Collection%3CItemStack%3E getDrops(GlowBlock block) %7B%0A        LinkedList%3CItemStack%3E list = new LinkedList%3CItemStack%3E();%0A%0A        list.add(new ItemStack(block.getType(), 1));%0A%0A        for (ItemStack i : ((TEContainer) block.getTileEntity()).getInventory().getContents()) %7B%0A            if (i != null) %7B%0A                list.add(i);%0A            %7D%0A        %7D%0A        return list;%0A    %7D%0A%0A
 %7D%0A

Implement container blocks dropping their contents.