Reorganised food

This commit is contained in:
Emmanuel BENOîT 2016-07-22 08:38:23 +02:00
parent e4ccf0a1a2
commit 3b195cac66
15 changed files with 94 additions and 41 deletions

View file

@ -4,6 +4,8 @@ package mmm;
import mmm.food.FIngredients; import mmm.food.FIngredients;
import mmm.food.FMeals; import mmm.food.FMeals;
import mmm.food.FMilks; import mmm.food.FMilks;
import mmm.food.FPies;
import mmm.food.FSoups;
@ -12,11 +14,15 @@ public class MmmFood
public static final FMilks MILK; public static final FMilks MILK;
public static final FIngredients INGREDIENT; public static final FIngredients INGREDIENT;
public static final FMeals MEAL; public static final FMeals MEAL;
public static final FPies PIE;
public static final FSoups SOUP;
static { static {
MILK = new FMilks( ); MILK = new FMilks( );
INGREDIENT = new FIngredients( ); INGREDIENT = new FIngredients( );
MEAL = new FMeals( ); MEAL = new FMeals( );
PIE = new FPies( );
SOUP = new FSoups( );
} }

View file

@ -18,7 +18,7 @@ public class FGlowingSoup
public FGlowingSoup( ) public FGlowingSoup( )
{ {
super( "glowing_soup" , 4 , 0.6f , // super( "soup" , "glowing" , 4 , 0.6f , //
"CCC" , "CPC" , " B " , // "CCC" , "CPC" , " B " , //
'C' , new ItemStack( MmmPlants.NETHER_CORAL.ITEM , 1 , OreDictionary.WILDCARD_VALUE ) , // 'C' , new ItemStack( MmmPlants.NETHER_CORAL.ITEM , 1 , OreDictionary.WILDCARD_VALUE ) , //
'P' , Items.POTATO ); 'P' , Items.POTATO );

View file

@ -18,10 +18,9 @@ public class FHelpers
final ItemFood item = new ItemFood( amount , saturation , wolfFood ); final ItemFood item = new ItemFood( amount , saturation , wolfFood );
item.setCreativeTab( CreativeTabs.FOOD ); item.setCreativeTab( CreativeTabs.FOOD );
String[] fullName = new String[ name.length + 2 ]; String[] fullName = new String[ name.length + 1 ];
fullName[ 0 ] = "food"; fullName[ 0 ] = "food";
fullName[ 1 ] = "meal"; System.arraycopy( name , 0 , fullName , 1 , name.length );
System.arraycopy( name , 0 , fullName , 2 , name.length );
CRegistry.setIdentifiers( item , fullName ); CRegistry.setIdentifiers( item , fullName );
CRegistry.addItem( item ); CRegistry.addItem( item );

View file

@ -22,12 +22,34 @@ public class FMealInBowl
private Object[] recipe; private Object[] recipe;
public FMealInBowl( final String name , final int amount , final float saturation , Object... recipe ) public FMealInBowl( final String section , final String name , final int amount , final float saturation ,
Object... recipe )
{ {
super( amount , saturation , false ); super( amount , saturation , false );
this.setMaxStackSize( 1 ); this.setMaxStackSize( 1 );
CRegistry.setIdentifiers( this , "food" , "meal" , name );
if ( recipe.length == 0 ) {
this.recipe = null;
} else if ( recipe[ 0 ] instanceof String ) {
this.recipe = new Object[ recipe.length + 2 ];
System.arraycopy( recipe , 0 , this.recipe , 0 , recipe.length );
this.recipe[ recipe.length ] = 'B';
this.recipe[ recipe.length + 1 ] = Items.BOWL;
} else {
this.recipe = new Object[ recipe.length + 1 ];
System.arraycopy( recipe , 0 , this.recipe , 0 , recipe.length );
this.recipe[ recipe.length ] = Items.BOWL;
}
CRegistry.setIdentifiers( this , "food" , section , name );
CRegistry.addItem( this ); CRegistry.addItem( this );
}
public FMealInBowl( int amount , float saturation , Object[] recipe )
{
super( amount , saturation , false );
this.setMaxStackSize( 1 );
if ( recipe.length == 0 ) { if ( recipe.length == 0 ) {
this.recipe = null; this.recipe = null;

View file

@ -2,50 +2,22 @@ package mmm.food;
import mmm.MmmFood; import mmm.MmmFood;
import mmm.MmmPlants;
import mmm.core.CRegistry;
import mmm.core.api.I_RecipeRegistrar;
import net.minecraft.init.Items; import net.minecraft.init.Items;
import net.minecraft.item.ItemFood;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fml.common.registry.GameRegistry;
public class FMeals public class FMeals
implements I_RecipeRegistrar
{ {
public final FSausage SAUSAGE; public final FSausage SAUSAGE;
public final FCookableMeal PASTA; public final FCookableMeal PASTA;
public final FMealInBowl TOMATO_SOUP;
public final FMealInBowl GLOWING_SOUP;
public final ItemFood APPLE_PIE;
public FMeals( ) public FMeals( )
{ {
CRegistry.addRegistrar( this );
this.SAUSAGE = new FSausage( ); this.SAUSAGE = new FSausage( );
this.PASTA = new FCookableMeal( "pasta" , 2 , 0.7f , 0.5f , false , 1 , // this.PASTA = new FCookableMeal( "pasta" , 2 , 0.7f , 0.5f , false , 1 , //
Items.EGG , MmmFood.INGREDIENT.FLOUR ); 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( );
this.APPLE_PIE = FHelpers.makeBasicMeal( 8 , 0.5f , false , "pie" , "apple" );
}
@Override
public void registerRecipes( )
{
GameRegistry.addShapelessRecipe( new ItemStack( this.APPLE_PIE ) , //
MmmFood.INGREDIENT.DOUGH , Items.SUGAR , Items.APPLE );
} }
} }

View file

@ -0,0 +1,34 @@
package mmm.food;
import mmm.MmmFood;
import mmm.core.CRegistry;
import mmm.core.api.I_RecipeRegistrar;
import net.minecraft.init.Items;
import net.minecraft.item.ItemFood;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fml.common.registry.GameRegistry;
public class FPies
implements I_RecipeRegistrar
{
public final ItemFood APPLE;
public FPies( )
{
this.APPLE = FHelpers.makeBasicMeal( 8 , 0.5f , false , "pie" , "apple" );
}
@Override
public void registerRecipes( )
{
CRegistry.addRegistrar( this );
GameRegistry.addShapelessRecipe( new ItemStack( this.APPLE ) , //
MmmFood.INGREDIENT.DOUGH , Items.SUGAR , Items.APPLE );
}
}

View file

@ -19,7 +19,7 @@ public class FSausage
{ {
super( "sausage" , 3 , 0.7f , 1.3f , true , 4 , // super( "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.DRIED = FHelpers.makeBasicMeal( 4 , 0.9f , true , "sausage" , "dried" ); this.DRIED = FHelpers.makeBasicMeal( 4 , 0.9f , true , "meal" , "sausage" , "dried" );
} }

View file

@ -0,0 +1,20 @@
package mmm.food;
import mmm.MmmPlants;
public class FSoups
{
public final FMealInBowl TOMATO;
public final FMealInBowl GLOWING;
public FSoups( )
{
this.TOMATO = new FMealInBowl( "soup" , "tomato" , 8 , 1.1f , //
"TTT" , " B " , 'T' , MmmPlants.TOMATO.FRUIT );
this.GLOWING = new FGlowingSoup( );
}
}

View file

@ -164,10 +164,10 @@ item.mmm.food.meal.sausage.dried.name=Dried Sausage
item.mmm.food.meal.pasta.raw.name=Pasta Dough item.mmm.food.meal.pasta.raw.name=Pasta Dough
item.mmm.food.meal.pasta.cooked.name=Pasta item.mmm.food.meal.pasta.cooked.name=Pasta
item.mmm.food.meal.tomato_soup.name=Tomato Soup item.mmm.food.soup.tomato.name=Tomato Soup
item.mmm.food.meal.glowing_soup.name=Glowing Soup item.mmm.food.soup.glowing.name=Glowing Soup
item.mmm.food.meal.pie.apple.name=Apple Pie item.mmm.food.pie.apple.name=Apple Pie
tile.mmm.deco.smoothstone.limestone.name=Polished Limestone tile.mmm.deco.smoothstone.limestone.name=Polished Limestone

View file

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

View file

@ -1,6 +1,6 @@
{ {
"parent": "minecraft:item/generated", "parent": "minecraft:item/generated",
"textures": { "textures": {
"layer0": "mmm:items/food/meal/tomato_soup" "layer0": "mmm:items/food/soup/glowing"
} }
} }

View file

@ -1,6 +1,6 @@
{ {
"parent": "minecraft:item/generated", "parent": "minecraft:item/generated",
"textures": { "textures": {
"layer0": "mmm:items/food/meal/glowing_soup" "layer0": "mmm:items/food/soup/tomato"
} }
} }

View file

Before

Width:  |  Height:  |  Size: 335 B

After

Width:  |  Height:  |  Size: 335 B

View file

Before

Width:  |  Height:  |  Size: 181 B

After

Width:  |  Height:  |  Size: 181 B

View file

Before

Width:  |  Height:  |  Size: 149 B

After

Width:  |  Height:  |  Size: 149 B