Skip to content

Commit

Permalink
Fix #297, soups can now be eaten again as I forgot to set the duratio…
Browse files Browse the repository at this point in the history
…n it takes to eat them.
  • Loading branch information
alexbegt committed Oct 22, 2016
1 parent 1655e85 commit d4a38cc
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 16 deletions.
20 changes: 10 additions & 10 deletions src/main/java/com/progwml6/natura/shared/NaturaCommons.java
Expand Up @@ -137,7 +137,7 @@ public void preInit(FMLPreInitializationEvent event)
blueberry = edibles.addFood(3, 1, 0.4F, 16, "blueberry", true);
blackberry = edibles.addFood(4, 1, 0.4F, 16, "blackberry", true);
maloberry = edibles.addFood(5, 1, 0.4F, 16, "maloberry", true);
berryMedley = soups.addFood(9, 5, 1.4F, "berry_medley", new ItemStack(Items.BOWL));
berryMedley = soups.addFood(9, 5, 1.4F, 32, "berry_medley", new ItemStack(Items.BOWL));
}

if (isNetherLoaded())
Expand All @@ -153,16 +153,16 @@ public void preInit(FMLPreInitializationEvent event)
darkwood_emptybowl = empty_bowls.addMeta(2, "darkwood_bowl");
fusewood_emptybowl = empty_bowls.addMeta(3, "fusewood_bowl");

ghostwood_mushroomstew = soups.addFood(0, 6, 0.6f, "ghostwood_mushroomstew", ghostwood_emptybowl);
bloodwood_mushroomstew = soups.addFood(1, 6, 0.6f, "bloodwood_mushroomstew", bloodwood_emptybowl);
darkwood_mushroomstew = soups.addFood(2, 6, 0.6f, "darkwood_mushroomstew", darkwood_emptybowl);
fusewood_mushroomstew = soups.addFood(3, 6, 0.6f, "fusewood_mushroomstew", fusewood_emptybowl);
ghostwood_mushroomstew = soups.addFood(0, 6, 0.6f, 32, "ghostwood_mushroomstew", ghostwood_emptybowl);
bloodwood_mushroomstew = soups.addFood(1, 6, 0.6f, 32, "bloodwood_mushroomstew", bloodwood_emptybowl);
darkwood_mushroomstew = soups.addFood(2, 6, 0.6f, 32, "darkwood_mushroomstew", darkwood_emptybowl);
fusewood_mushroomstew = soups.addFood(3, 6, 0.6f, 32, "fusewood_mushroomstew", fusewood_emptybowl);

vanilla_glowshroomstew = soups.addFood(4, 6, 0.6f, "vanilla_glowshroomstew", new ItemStack(Items.BOWL), new PotionEffect(MobEffects.NIGHT_VISION, 45 * 25, 0), new PotionEffect(MobEffects.POISON, 16 * 25, 0), new PotionEffect(MobEffects.MINING_FATIGUE, 8 * 25, 0));
ghostwood_glowshroomstew = soups.addFood(5, 6, 0.6f, "ghostwood_glowshroomstew", ghostwood_emptybowl, new PotionEffect(MobEffects.NIGHT_VISION, 45 * 25, 0), new PotionEffect(MobEffects.POISON, 16 * 25, 0), new PotionEffect(MobEffects.MINING_FATIGUE, 8 * 25, 0));
bloodwood_glowshroomstew = soups.addFood(6, 3, 0.2f, "bloodwood_glowshroomstew", bloodwood_emptybowl, new PotionEffect(MobEffects.NIGHT_VISION, 45 * 25, 0), new PotionEffect(MobEffects.POISON, 16 * 25, 0), new PotionEffect(MobEffects.MINING_FATIGUE, 8 * 25, 0));
darkwood_glowshroomstew = soups.addFood(7, 3, 0.2f, "darkwood_glowshroomstew", darkwood_emptybowl, new PotionEffect(MobEffects.NIGHT_VISION, 45 * 25, 0), new PotionEffect(MobEffects.POISON, 16 * 25, 0), new PotionEffect(MobEffects.MINING_FATIGUE, 8 * 25, 0));
fusewood_glowshroomstew = soups.addFood(8, 3, 0.2f, "fusewood_glowshroomstew", fusewood_emptybowl, new PotionEffect(MobEffects.NIGHT_VISION, 45 * 25, 0), new PotionEffect(MobEffects.POISON, 16 * 25, 0), new PotionEffect(MobEffects.MINING_FATIGUE, 8 * 25, 0));
vanilla_glowshroomstew = soups.addFood(4, 6, 0.6f, 32, "vanilla_glowshroomstew", new ItemStack(Items.BOWL), new PotionEffect(MobEffects.NIGHT_VISION, 45 * 25, 0), new PotionEffect(MobEffects.POISON, 16 * 25, 0), new PotionEffect(MobEffects.MINING_FATIGUE, 8 * 25, 0));
ghostwood_glowshroomstew = soups.addFood(5, 6, 0.6f, 32, "ghostwood_glowshroomstew", ghostwood_emptybowl, new PotionEffect(MobEffects.NIGHT_VISION, 45 * 25, 0), new PotionEffect(MobEffects.POISON, 16 * 25, 0), new PotionEffect(MobEffects.MINING_FATIGUE, 8 * 25, 0));
bloodwood_glowshroomstew = soups.addFood(6, 3, 0.2f, 32, "bloodwood_glowshroomstew", bloodwood_emptybowl, new PotionEffect(MobEffects.NIGHT_VISION, 45 * 25, 0), new PotionEffect(MobEffects.POISON, 16 * 25, 0), new PotionEffect(MobEffects.MINING_FATIGUE, 8 * 25, 0));
darkwood_glowshroomstew = soups.addFood(7, 3, 0.2f, 32, "darkwood_glowshroomstew", darkwood_emptybowl, new PotionEffect(MobEffects.NIGHT_VISION, 45 * 25, 0), new PotionEffect(MobEffects.POISON, 16 * 25, 0), new PotionEffect(MobEffects.MINING_FATIGUE, 8 * 25, 0));
fusewood_glowshroomstew = soups.addFood(8, 3, 0.2f, 32, "fusewood_glowshroomstew", fusewood_emptybowl, new PotionEffect(MobEffects.NIGHT_VISION, 45 * 25, 0), new PotionEffect(MobEffects.POISON, 16 * 25, 0), new PotionEffect(MobEffects.MINING_FATIGUE, 8 * 25, 0));

proxy.preInit();

Expand Down
Expand Up @@ -15,19 +15,19 @@ public class ItemEdibleSoup extends ItemNaturaEdible
public ItemEdibleSoup()
{
super();
this.bowlsList = new TIntObjectHashMap<ItemStack>();
this.bowlsList = new TIntObjectHashMap<>();
}

public ItemStack addFood(int meta, int food, float saturation, String name, ItemStack bowl, PotionEffect... effects)
public ItemStack addFood(int meta, int food, float saturation, int duration, String name, ItemStack bowl, PotionEffect... effects)
{
return this.addFood(meta, food, saturation, name, bowl, effects.length > 0, effects);
return this.addFood(meta, food, saturation, duration, name, bowl, effects.length > 0, effects);
}

public ItemStack addFood(int meta, int food, float saturation, String name, ItemStack bowl, boolean alwaysEdible, PotionEffect... effects)
public ItemStack addFood(int meta, int food, float saturation, int duration, String name, ItemStack bowl, boolean alwaysEdible, PotionEffect... effects)
{
this.bowlsList.put(meta, bowl);

return super.addFood(meta, food, saturation, name, alwaysEdible, effects);
return super.addFood(meta, food, saturation, duration, name, alwaysEdible, effects);
}

/**
Expand Down
Expand Up @@ -10,6 +10,7 @@
import net.minecraft.util.text.translation.I18n;
import slimeknights.mantle.item.ItemEdible;

@SuppressWarnings("deprecation")
public class ItemNaturaEdible extends ItemEdible
{
protected TIntIntHashMap itemDuration;
Expand Down Expand Up @@ -44,7 +45,6 @@ public int getMaxItemUseDuration(ItemStack stack)
return itemDuration.get(stack.getMetadata());
}

@SuppressWarnings("deprecation")
@Override
public void addInformation(ItemStack stack, EntityPlayer playerIn, List<String> tooltip, boolean advanced)
{
Expand Down

0 comments on commit d4a38cc

Please sign in to comment.