Made salads give the bowl back when eaten.

This commit is contained in:
Matt Caughey 2013-07-11 19:24:04 -04:00
parent 08ac9eea26
commit a6ef09ee02
1 changed files with 13 additions and 0 deletions

View File

@ -5,6 +5,7 @@ import java.util.List;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemFood;
import net.minecraft.item.ItemStack;
import net.minecraft.potion.Potion;
@ -93,6 +94,18 @@ public class ItemBOPFood extends ItemFood
player.getFoodStats().setFoodSaturationLevel(player.getFoodStats().getSaturationLevel() + saturation);
world.playSoundAtEntity(player, "random.burp", 0.5F, world.rand.nextFloat() * 0.1F + 0.9F);
this.onFoodEaten(itemstack, world, player);
if (itemstack.getItemDamage() == 4)
{
return new ItemStack(Item.bowlEmpty);
}
if (itemstack.getItemDamage() == 5)
{
return new ItemStack(Item.bowlEmpty);
}
if (itemstack.getItemDamage() == 6)
{
return new ItemStack(Item.bowlEmpty);
}
return itemstack;
}