/*
 * Copyright (c) 2017 Nedelosk, Mezz
 *
 * This work (the MOD) is licensed under the "MIT" License, see LICENSE for details.
 */
package oreregistry;

import java.util.List;

import net.minecraft.entity.item.EntityItem;
import net.minecraft.item.ItemStack;
import net.minecraft.util.text.TextFormatting;
import net.minecraft.util.text.translation.I18n;
import net.minecraft.world.World;

import net.minecraftforge.event.entity.item.ItemTossEvent;
import net.minecraftforge.event.entity.player.ItemTooltipEvent;
import net.minecraftforge.event.entity.player.PlayerDropsEvent;

import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.fml.common.gameevent.PlayerEvent;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

import oreregistry.api.OreRegistryApi;
import oreregistry.api.info.IProductInfo;
import oreregistry.network.PacketHandler;
import oreregistry.util.ProductUtils;

public class EventHandler {

	@SideOnly(Side.CLIENT)
	@SubscribeEvent
	public void handleTooltip(ItemTooltipEvent event) {
		if (event.isShowAdvancedItemTooltips()) {
			IProductInfo product = OreRegistryApi.info.getProductInfo(event.getItemStack());
			if (product != null) {
				List<String> tooltip = event.getToolTip();
				boolean isChosen = product.isChosenVariant();
				tooltip.add((isChosen ? TextFormatting.GOLD : TextFormatting.DARK_GRAY).toString() + I18n.translateToLocal("or.resource.name") + product.getResourceType());
				tooltip.add((isChosen ? TextFormatting.GOLD : TextFormatting.DARK_GRAY).toString() + I18n.translateToLocal("or.product.type.name") + product.getProductType());
			}
		}
	}
	
	@SubscribeEvent
	public void handleTooltip(PlayerDropsEvent event) {
		for(EntityItem entityItem : event.getDrops()){
			ItemStack itemStack = ProductUtils.tryUnifyItem(entityItem.getEntityItem());
			if(!itemStack.isEmpty()){
				entityItem.setEntityItemStack(itemStack);
			}
		}
	}
	
	@SubscribeEvent
	public void handleTooltip(ItemTossEvent event) {
		EntityItem entityItem = event.getEntityItem();
		ItemStack itemStack = ProductUtils.tryUnifyItem(entityItem.getEntityItem());
		if(!itemStack.isEmpty()){
			entityItem.setEntityItemStack(itemStack);
		}
	}
	
	@SubscribeEvent
	public void handlePlayerLoggedIn(PlayerEvent.PlayerLoggedInEvent event) {
		World world = event.player.world;
		if(!world.isRemote){
			PacketHandler.sendToClients(event.player);
		}
	}

}

@@ -143,24 +143,79 @@
 eregistry;%0A%0A
+import java.util.ArrayList;%0Aimport java.util.Iterator;%0A
 import java.
@@ -225,16 +225,16 @@
 l.List;%0A
-
 %0Aimport 
@@ -625,16 +625,66 @@
 psEvent;
+%0Aimport net.minecraftforge.event.world.BlockEvent;
 %0A%0Aimport
@@ -1813,23 +1813,500 @@
 d handle
-Tooltip
+Drops(BlockEvent.HarvestDropsEvent event) %7B%0A%09%09List%3CItemStack%3E drops = event.getDrops();%0A%09%09List%3CItemStack%3E newDrops = new ArrayList%3C%3E();%0A%09%09Iterator%3CItemStack%3E dropsIterator = event.getDrops().iterator();%0A%09%09while(dropsIterator.hasNext())%7B%0A%09%09%09ItemStack itemStack = ProductUtils.tryUnifyItem(dropsIterator.next());%0A%09%09%09if(!itemStack.isEmpty())%7B%0A%09%09%09%09dropsIterator.remove();%0A%09%09%09%09newDrops.add(itemStack);%0A%09%09%09%7D%0A%09%09%7D%0A%09%09drops.addAll(newDrops);%0A%09%7D%0A%09%0A%09@SubscribeEvent%0A%09public void handlePlayerDrops
 (PlayerD
@@ -2576,29 +2576,26 @@
 oid handleTo
-oltip
+ss
 (ItemTossEve

Rename EventHandler methods