/*
 * Copyright  2014 - 2017 | Wurst-Imperium | All rights reserved.
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 */
package tk.wurst_client.features.mods;

import net.minecraft.item.ItemFood;
import net.minecraft.network.play.client.CPacketPlayer;
import tk.wurst_client.events.listeners.UpdateListener;

@Mod.Info(
	description = "Allows you to eat food much faster.\n" + "OM! NOM! NOM!",
	name = "FastEat",
	tags = "FastNom, fast eat, fast nom",
	help = "Mods/FastEat")
@Mod.Bypasses(ghostMode = false, latestNCP = false, olderNCP = false)
public class FastEatMod extends Mod implements UpdateListener
{
	@Override
	public void onEnable()
	{
		wurst.events.add(UpdateListener.class, this);
	}
	
	@Override
	public void onDisable()
	{
		wurst.events.remove(UpdateListener.class, this);
	}
	
	@Override
	public void onUpdate()
	{
		if(mc.player.getHealth() > 0 && mc.player.onGround
			&& mc.player.inventory.getCurrentItem() != null
			&& mc.player.inventory.getCurrentItem()
				.getItem() instanceof ItemFood
			&& mc.player.getFoodStats().needFood()
			&& mc.gameSettings.keyBindUseItem.pressed)
			for(int i = 0; i < 100; i++)
				mc.player.connection.sendPacket(new CPacketPlayer(false));
	}
}

@@ -347,16 +347,53 @@
 emFood;%0A
+import net.minecraft.item.ItemStack;%0A
 import n
@@ -440,16 +440,16 @@
 Player;%0A
-
 import t
@@ -495,16 +495,61 @@
 istener;
+%0Aimport tk.wurst_client.utils.InventoryUtils;
 %0A%0A@Mod.I
@@ -1067,16 +1067,36 @@
 te()%0A%09%7B%0A
+%09%09// check if alive%0A
 %09%09if(mc.
@@ -1118,15 +1118,54 @@
 h() 
-%3E 0 && 
+%3C= 0)%0A%09%09%09return;%0A%09%09%0A%09%09// check onGround%0A%09%09if(!
 mc.p
@@ -1182,65 +1182,226 @@
 ound
+)
 %0A%09%09%09
-&& mc.player.inventory.g
+return;%0A%09%09%0A%09%09// check if eating%0A%09%09if(!mc.gameSettings.keyBindUseItem.pressed)%0A%09%09%09r
 et
-C
 ur
-rentItem() != null%0A%09%09%09&&
+n;%0A%09%09%0A%09%09// check hunger level%0A%09%09if(!mc.player.getFoodStats().needFood())%0A%09%09%09return;%0A%09%09%0A%09%09// check held item%0A%09%09ItemStack stack =
  mc.
@@ -1433,21 +1433,70 @@
 ntItem()
+;
 %0A%09%09
-%09%09
+if(InventoryUtils.isEmptySlot(stack)%0A%09%09%09%7C%7C !(stack
 .getItem
@@ -1521,98 +1521,43 @@
 Food
+))
 %0A%09%09%09
-&& mc.player.getFoodStats().needFood()%0A%09%09%09&& mc.gameSettings.keyBindUseItem.pressed)%0A%09
+return;%0A%09%09%0A%09%09// send packets%0A
 %09%09fo
@@ -1583,17 +1583,16 @@
 0; i++)%0A
-%09
 %09%09%09mc.pl

Update FastEatMod