From 1de5956dd26ca1ad2f5826913129ad72ffa9a1d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emmanuel=20Beno=C3=AEt?= Date: Thu, 21 Jul 2016 15:30:34 +0200 Subject: [PATCH] Glowing soup! --- src/java/mmm/food/FGlowingSoup.java | 39 ++++++++++++++++++ src/java/mmm/food/FMeals.java | 3 ++ src/resources/assets/mmm/lang/en_US.lang | 1 + .../models/item/food/meal/glowing_soup.json | 6 +++ .../textures/items/food/meal/glowing_soup.png | Bin 0 -> 181 bytes 5 files changed, 49 insertions(+) create mode 100644 src/java/mmm/food/FGlowingSoup.java create mode 100644 src/resources/assets/mmm/models/item/food/meal/glowing_soup.json create mode 100644 src/resources/assets/mmm/textures/items/food/meal/glowing_soup.png 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 0000000000000000000000000000000000000000..e59d48be85b8ab3a12a2d98e3e274b408e2c2d03 GIT binary patch literal 181 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`HJ&bxAr_~T6C_x-Fec{B`oA%8 zk?Ftx-=F-yw)_9VFaPU5D}H(U^9S!H^I+$UT{iOTeja^v(xc6m@v~#rMk$8F2E7Kp z2F??&CP*mgpZc=j^sqqBL{X*W8R8CE8>^Ua3J9FzyXttb!cCnMxb2KE>{7OO& gnM_zy_=1r^rhiG$TeZc!KzA^By85}Sb4q9e04K;t9smFU literal 0 HcmV?d00001