package ljfa.glassshards.util;

import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;

import ljfa.glassshards.Config;
import ljfa.glassshards.Reference;
import ljfa.glassshards.api.GlassType;
import ljfa.glassshards.compat.ChiselGlassHelper;
import ljfa.glassshards.compat.TinkersGlassHelper;
import net.minecraft.block.Block;

import org.apache.logging.log4j.Level;

import cpw.mods.fml.common.FMLLog;
import cpw.mods.fml.common.Loader;

/**
 * Class that handles glasses form other mods that don't implement the API.
 * Using the API is preferred before this.
 * 
 * Blocks and mappings can be added with addRemoveDrops and addHandler.
 */
public class GlassRegistry {
    /** Adds a block for which all drops should be removed */
    public static void addRemoveDrops(Block block) {
        removeDropsSet.add(block);
        LogHelper.trace("Removed drops from %s (%d)", block.getUnlocalizedName(), Block.getIdFromBlock(block));
    }
    
    /** Adds a handler for a given glass block */
    public static void addHandler(Block block, ModGlassHandler handler) {
        handlerMap.put(block, handler);
        LogHelper.trace("Added glass handler for %s (%d)", block.getUnlocalizedName(), Block.getIdFromBlock(block));
    }
    
    /** Checks if the drops should be removed for this block */
    public static boolean shouldRemoveDrop(Block block, int meta) {
        return removeDropsSet.contains(block);
    }
    
    /** 
     * Calls the assigned handler for this block if one exists.
     * @return The type as returned by the handler, or null if no handler exists.
     */
    public static GlassType getType(Block block, int meta) {
        ModGlassHandler helper = handlerMap.get(block);
        if(helper != null)
            return helper.getType(block, meta);
        else
            return null;
    }
    
    /** Set of blocks for which the drops should be removed */
    private static Set<Block> removeDropsSet = new HashSet<Block>();
    /** Map that assigns a handler to each glass block */
    private static Map<Block, ModGlassHandler> handlerMap = new HashMap<Block, ModGlassHandler>();
}

@@ -602,84 +602,8 @@
 is.%0A
- * %0A * Blocks and mappings can be added with addRemoveDrops and addHandler.%0A
  */%0A
@@ -1798,17 +1798,29 @@
     /** 
-S
+@return the s
 et of bl
@@ -1862,24 +1862,25 @@
 removed 
+ 
 */%0A    p
 rivate s
@@ -1863,38 +1863,37 @@
 emoved  */%0A    p
-rivate
+ublic
  static Set%3CBloc
@@ -1895,17 +1895,20 @@
 %3CBlock%3E 
-r
+getR
 emoveDro
@@ -1916,90 +1916,291 @@
 sSet
- = new HashSet%3CBlock%3E();%0A    /** Map that assigns a handler to each glass block */
+() %7B%0A        return removeDropsSet;%0A    %7D%0A%0A    /** @return the map that assigns a handler to each glass block */%0A    public static Map%3CBlock, ModGlassHandler%3E getHandlerMap() %7B%0A        return handlerMap;%0A    %7D%0A    %0A    private static Set%3CBlock%3E removeDropsSet = new HashSet%3CBlock%3E();
 %0A   

Add getters