package ljfa.glassshards.handlers;

import ljfa.glassshards.Config;
import ljfa.glassshards.items.ModItems;
import ljfa.glassshards.util.GlassHelper;
import net.minecraft.item.ItemStack;
import net.minecraftforge.event.world.BlockEvent;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;

public class HarvestDropsHandler {
    
    @SubscribeEvent
    public void onBlockHarvested(BlockEvent.HarvestDropsEvent event) {
        if(event.world.isRemote || event.isSilkTouching)
            return;
        
        // Sometimes the list of drops is not empty even if the drop chance is set to zero.
        // This might lead to duplication bugs.
        if(event.dropChance < 0.0001f)
            event.drops.clear();
        else if(!event.drops.isEmpty())
            return;
        
        GlassHelper.GlassType gtype = GlassHelper.getType(event.block, event.blockMetadata);
        if(gtype != null) {
            int meta;
            if(GlassHelper.isGlassStained(event.block, event.blockMetadata))
                meta = GlassHelper.getGlassColor(event.block, event.blockMetadata);
            else
                meta = 16;
            event.drops.add(new ItemStack(ModItems.glass_shards, 1, meta));
            
            float chance = Math.min(Config.shardsChance + event.fortuneLevel*Config.shardsFortuneChance, 1.0f);
            event.dropChance = gtype.multiplier * chance;
        }
    }
}

@@ -40,31 +40,106 @@
 ort 
-ljfa.glassshards.Config
+org.apache.logging.log4j.Level;%0A%0Aimport ljfa.glassshards.Config;%0Aimport ljfa.glassshards.Reference
 ;%0Aim
@@ -305,16 +305,51 @@
 kEvent;%0A
+import cpw.mods.fml.common.FMLLog;%0A
 import c
@@ -754,16 +754,57 @@
 n bugs.%0A
+        if(!event.drops.isEmpty()) %7B%0A    
         
@@ -833,16 +833,18 @@
 0.0001f)
+ %7B
 %0A       
@@ -840,32 +840,36 @@
 ) %7B%0A            
+    
 event.drops.clea
@@ -885,39 +885,197 @@
     
+    
-else if(!event.drops.isEmpty
+    FMLLog.log(Reference.MODID, Level.INFO,%0A                    %22%25s has a negligible drop chance, but the drop list is not empty%22,%0A                    event.block.getUnlocalizedName
 ())
+;
 %0A   
@@ -1075,39 +1075,84 @@
 ));%0A            
-return;
+%7D%0A            else%0A                return;%0A        %7D
 %0A        %0A      

Add info to log