This commit is contained in:
Emmanuel BENOîT 2016-07-21 10:35:00 +02:00
parent ff9bf5d16c
commit ec80d8de95
10 changed files with 38 additions and 7 deletions

View file

@ -21,7 +21,6 @@ food No Extra recipes
Apple pie Apple pie
Ratatouille Ratatouille
Tomato stew Tomato stew
Pasta
Pasta w/tomato Pasta w/tomato
Beef stew Beef stew
Pizza Pizza

BIN
graphics/pasta-dough.xcf Normal file

Binary file not shown.

BIN
graphics/pasta.xcf Normal file

Binary file not shown.

View file

@ -6,6 +6,7 @@ import mmm.core.api.I_RecipeRegistrar;
import net.minecraft.init.MobEffects; import net.minecraft.init.MobEffects;
import net.minecraft.item.ItemFood; import net.minecraft.item.ItemFood;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.potion.Potion;
import net.minecraft.potion.PotionEffect; import net.minecraft.potion.PotionEffect;
import net.minecraftforge.fml.common.registry.GameRegistry; import net.minecraftforge.fml.common.registry.GameRegistry;
@ -22,12 +23,25 @@ public class FCookableMeal
private Object[] recipe; private Object[] recipe;
public FCookableMeal( final String name , final int amount , final float saturation , final boolean dangerous , public FCookableMeal( final String name , final int amount , final float saturation , float danger ,
final boolean wolfLikes , final int quantity , final Object... recipe ) final boolean wolfLikes , final int quantity , final Object... recipe )
{ {
this.RAW = new ItemFood( Math.max( 1 , amount / 3 ) , saturation / 3f , wolfLikes ); this.RAW = new ItemFood( Math.max( 1 , amount / 3 ) , saturation / 3f , wolfLikes );
if ( dangerous ) { if ( danger > 0 ) {
this.RAW.setPotionEffect( new PotionEffect( MobEffects.HUNGER , 600 , 0 ) , .3f ); Potion effect;
if ( danger > 1 ) {
if ( danger > 2 ) {
effect = MobEffects.POISON;
danger -= 2;
} else {
effect = MobEffects.NAUSEA;
danger -= 1;
}
} else {
effect = MobEffects.HUNGER;
}
this.RAW.setPotionEffect( new PotionEffect( effect , 600 , 0 ) , Math.min( 1f , danger ) );
} }
CRegistry.setIdentifiers( this.RAW , "food" , "meal" , name , "raw" ); CRegistry.setIdentifiers( this.RAW , "food" , "meal" , name , "raw" );
CRegistry.addItem( this.RAW ); CRegistry.addItem( this.RAW );
@ -53,8 +67,7 @@ public class FCookableMeal
} }
this.recipe = null; this.recipe = null;
} }
FHelpers.addCooking( this.RAW , this.COOKED );
GameRegistry.addSmelting( this.RAW , new ItemStack( this.COOKED ) , 0.15f );
} }
} }

View file

@ -1,6 +1,7 @@
package mmm.food; package mmm.food;
import mmm.MmmFood;
import mmm.MmmMaterials; import mmm.MmmMaterials;
import net.minecraft.init.Items; import net.minecraft.init.Items;
@ -10,12 +11,15 @@ public class FMeals
{ {
public final FCookableMeal SAUSAGE; public final FCookableMeal SAUSAGE;
public final FCookableMeal PASTA;
public FMeals( ) public FMeals( )
{ {
this.SAUSAGE = new FCookableMeal( "sausage" , 3 , 0.7f , true , true , 4 , // this.SAUSAGE = new FCookableMeal( "sausage" , 3 , 0.7f , 1.3f , true , 4 , //
Items.PORKCHOP , MmmMaterials.ITEM.ROCK_SALT , Items.LEATHER ); Items.PORKCHOP , MmmMaterials.ITEM.ROCK_SALT , Items.LEATHER );
this.PASTA = new FCookableMeal( "pasta" , 2 , 0.7f , 0.5f , false , 1 , //
Items.EGG , MmmFood.INGREDIENT.FLOUR );
} }
} }

View file

@ -149,6 +149,9 @@ item.mmm.food.ingredient.flour.name=Wheat Flour
item.mmm.food.meal.sausage.raw.name=Raw Sausage item.mmm.food.meal.sausage.raw.name=Raw Sausage
item.mmm.food.meal.sausage.cooked.name=Sausage item.mmm.food.meal.sausage.cooked.name=Sausage
item.mmm.food.meal.pasta.raw.name=Pasta Dough
item.mmm.food.meal.pasta.cooked.name=Pasta
tile.mmm.deco.smoothstone.limestone.name=Polished Limestone tile.mmm.deco.smoothstone.limestone.name=Polished Limestone
tile.mmm.deco.smoothstone.basalt.name=Polished Basalt tile.mmm.deco.smoothstone.basalt.name=Polished Basalt

View file

@ -0,0 +1,6 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "mmm:items/food/meal/pasta/cooked"
}
}

View file

@ -0,0 +1,6 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "mmm:items/food/meal/pasta/raw"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 168 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 468 B