Made SpecialFood use 1.7.10 methods to get hunger/saturation values and fixed bacon crash

Closes SlimeKnights/TinkersConstruct#729
This commit is contained in:
squeek committed 2014-07-20 17:41:15 -07:00
1 parent beffc0b162
commit fdac54cd7e
2 files changed
+9 -8

No files matched your search

@@ -32,14 +32,15 @@ public class SpecialFood extends ItemFood
}
@Override
public ItemStack onEaten (ItemStack stack, World world, EntityPlayer player)
public int func_150905_g(ItemStack stack)
{
stack.stackSize--;
int damage = stack.getItemDamage();
player.getFoodStats().addStats(hunger[damage], saturation[damage]);
world.playSoundAtEntity(player, "random.burp", 0.5F, world.rand.nextFloat() * 0.1F + 0.9F);
this.onFoodEaten(stack, world, player);
return stack;
return hunger[stack.getItemDamage()];
}
@Override
public float func_150906_h(ItemStack stack)
{
return saturation[stack.getItemDamage()];
}
@Override
@@ -15,7 +15,7 @@ public class StrangeFood extends SpecialFood
{
public StrangeFood()
{
super(new int[] { 2, 2 }, new float[] { 1f, 1f }, new String[] { "edibleslime", "edibleblood", "bacon" }, new String[] { "food/edibleslime", "food/edibleblood", "food/bacon" });
super(new int[] { 2, 2, 4 }, new float[] { 1f, 1f, 0.6f }, new String[] { "edibleslime", "edibleblood", "bacon" }, new String[] { "food/edibleslime", "food/edibleblood", "food/bacon" });
}
@Override