package squeek.veganoption.helpers;

import java.lang.reflect.Method;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntityHopper;
import net.minecraft.util.EnumFacing;
import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.ReflectionHelper;

public class InventoryHelper
{
	public static final Method hopperInsertIntoInventory = ReflectionHelper.findMethod(TileEntityHopper.class, null, new String[]{"func_145899_c", "c"}, IInventory.class, ItemStack.class, int.class, int.class);

	public static IInventory getInventoryAtLocation(World world, int x, int y, int z)
	{
		return TileEntityHopper.getInventoryAtPosition(world, x, y, z);
	}

	public static ItemStack insertStackIntoInventory(ItemStack itemStack, IInventory inventory)
	{
		return TileEntityHopper.putStackInInventoryAllSlots(inventory, itemStack, EnumFacing.DOWN);
	}

	public static float getPercentInventoryFilled(IInventory inventory)
	{
		if (inventory == null || inventory.getSizeInventory() == 0)
			return 0;

		float filledPercent = 0.0F;

		for (int slotNum = 0; slotNum < inventory.getSizeInventory(); ++slotNum)
		{
			ItemStack itemstack = inventory.getStackInSlot(slotNum);

			if (itemstack != null)
			{
				filledPercent += (float) itemstack.stackSize / (float) Math.min(inventory.getInventoryStackLimit(), itemstack.getMaxStackSize());
			}
		}

		filledPercent /= inventory.getSizeInventory();
		return filledPercent;
	}
}

@@ -34,41 +34,8 @@
 s;%0A%0A
-import java.lang.reflect.Method;%0A
 impo
@@ -236,307 +236,39 @@
 ld;%0A
-import net.minecraftforge.fml.relauncher.ReflectionHelper;%0A%0Apublic class InventoryHelper%0A%7B%0A%09public static final Method hopperInsertIntoInventory = ReflectionHelper.findMethod(TileEntityHopper.class, null, new String%5B%5D%7B%22func_145899_c%22, %22c%22%7D, IInventory.class, ItemStack.class, int.class, int.class);%0A
+%0Apublic class InventoryHelper%0A%7B
 %0A%09pu

Remove unused reflection from InventoryHelper. This also resolves a crash when using inventories from TVO