diff --git a/src/java/mmm/food/FGlowingSoup.java b/src/java/mmm/food/FGlowingSoup.java new file mode 100644 index 0000000..162ea02 --- /dev/null +++ b/src/java/mmm/food/FGlowingSoup.java @@ -0,0 +1,39 @@ +package mmm.food; + + +import mmm.MmmPlants; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Items; +import net.minecraft.init.MobEffects; +import net.minecraft.item.ItemStack; +import net.minecraft.potion.PotionEffect; +import net.minecraft.world.World; +import net.minecraftforge.oredict.OreDictionary; + + + +public class FGlowingSoup + extends FMealInBowl +{ + + public FGlowingSoup( ) + { + super( "glowing_soup" , 4 , 0.6f , // + "CCC" , "CPC" , " B " , // + 'C' , new ItemStack( MmmPlants.NETHER_CORAL.ITEM , 1 , OreDictionary.WILDCARD_VALUE ) , // + 'P' , Items.POTATO ); + } + + + @Override + protected void onFoodEaten( final ItemStack stack , final World worldIn , final EntityPlayer player ) + { + super.onFoodEaten( stack , worldIn , player ); + if ( !worldIn.isRemote && worldIn.rand.nextFloat( ) < .25f ) { + final int duration = 300 + worldIn.rand.nextInt( 1200 ); + player.addPotionEffect( new PotionEffect( MobEffects.GLOWING , duration ) ); + player.addPotionEffect( new PotionEffect( MobEffects.NIGHT_VISION , duration ) ); + } + } + +} diff --git a/src/java/mmm/food/FMeals.java b/src/java/mmm/food/FMeals.java index 53e8543..5a3927f 100644 --- a/src/java/mmm/food/FMeals.java +++ b/src/java/mmm/food/FMeals.java @@ -14,6 +14,7 @@ public class FMeals public final FCookableMeal SAUSAGE; public final FCookableMeal PASTA; public final FMealInBowl TOMATO_SOUP; + public final FMealInBowl GLOWING_SOUP; public FMeals( ) @@ -24,6 +25,8 @@ public class FMeals Items.EGG , MmmFood.INGREDIENT.FLOUR ); this.TOMATO_SOUP = new FMealInBowl( "tomato_soup" , 8 , 1.1f , // "TTT" , " B " , 'T' , MmmPlants.TOMATO.FRUIT ); + + this.GLOWING_SOUP = new FGlowingSoup( ); } } diff --git a/src/resources/assets/mmm/lang/en_US.lang b/src/resources/assets/mmm/lang/en_US.lang index 7c3d2e2..500e895 100644 --- a/src/resources/assets/mmm/lang/en_US.lang +++ b/src/resources/assets/mmm/lang/en_US.lang @@ -160,6 +160,7 @@ item.mmm.food.meal.pasta.raw.name=Pasta Dough item.mmm.food.meal.pasta.cooked.name=Pasta item.mmm.food.meal.tomato_soup.name=Tomato Soup +item.mmm.food.meal.glowing_soup.name=Glowing Soup tile.mmm.deco.smoothstone.limestone.name=Polished Limestone diff --git a/src/resources/assets/mmm/models/item/food/meal/glowing_soup.json b/src/resources/assets/mmm/models/item/food/meal/glowing_soup.json new file mode 100644 index 0000000..8481f49 --- /dev/null +++ b/src/resources/assets/mmm/models/item/food/meal/glowing_soup.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "mmm:items/food/meal/glowing_soup" + } +} \ No newline at end of file diff --git a/src/resources/assets/mmm/textures/items/food/meal/glowing_soup.png b/src/resources/assets/mmm/textures/items/food/meal/glowing_soup.png new file mode 100644 index 0000000..e59d48b Binary files /dev/null and b/src/resources/assets/mmm/textures/items/food/meal/glowing_soup.png differ