Skip to content

Commit

Permalink
Made SpecialFood use 1.7.10 methods to get hunger/saturation values a…
Browse files Browse the repository at this point in the history
…nd fixed bacon crash

Closes #729
  • Loading branch information
squeek502 committed Jul 21, 2014
1 parent beffc0b commit fdac54c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
15 changes: 8 additions & 7 deletions src/main/java/tconstruct/world/items/SpecialFood.java
Expand Up @@ -32,14 +32,15 @@ public SpecialFood(int[] hunger, float[] saturation, String[] textureNames, Stri
}

@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
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/tconstruct/world/items/StrangeFood.java
Expand Up @@ -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
Expand Down

0 comments on commit fdac54c

Please sign in to comment.