Skip to content

Commit

Permalink
Merge pull request #758 from squeek502/food-fixes
Browse files Browse the repository at this point in the history
Made SpecialFood use 1.7.10 methods to get hunger/saturation values and fixed bacon crash
  • Loading branch information
mDiyo committed Jul 21, 2014
2 parents 6e5bbf1 + fdac54c commit c43bbf1
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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 c43bbf1

Please sign in to comment.