Reorganised food
This commit is contained in:
parent
e4ccf0a1a2
commit
3b195cac66
15 changed files with 94 additions and 41 deletions
|
@ -4,6 +4,8 @@ package mmm;
|
|||
import mmm.food.FIngredients;
|
||||
import mmm.food.FMeals;
|
||||
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 FIngredients INGREDIENT;
|
||||
public static final FMeals MEAL;
|
||||
public static final FPies PIE;
|
||||
public static final FSoups SOUP;
|
||||
|
||||
static {
|
||||
MILK = new FMilks( );
|
||||
INGREDIENT = new FIngredients( );
|
||||
MEAL = new FMeals( );
|
||||
PIE = new FPies( );
|
||||
SOUP = new FSoups( );
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@ public class FGlowingSoup
|
|||
|
||||
public FGlowingSoup( )
|
||||
{
|
||||
super( "glowing_soup" , 4 , 0.6f , //
|
||||
super( "soup" , "glowing" , 4 , 0.6f , //
|
||||
"CCC" , "CPC" , " B " , //
|
||||
'C' , new ItemStack( MmmPlants.NETHER_CORAL.ITEM , 1 , OreDictionary.WILDCARD_VALUE ) , //
|
||||
'P' , Items.POTATO );
|
||||
|
|
|
@ -18,10 +18,9 @@ public class FHelpers
|
|||
final ItemFood item = new ItemFood( amount , saturation , wolfFood );
|
||||
item.setCreativeTab( CreativeTabs.FOOD );
|
||||
|
||||
String[] fullName = new String[ name.length + 2 ];
|
||||
String[] fullName = new String[ name.length + 1 ];
|
||||
fullName[ 0 ] = "food";
|
||||
fullName[ 1 ] = "meal";
|
||||
System.arraycopy( name , 0 , fullName , 2 , name.length );
|
||||
System.arraycopy( name , 0 , fullName , 1 , name.length );
|
||||
CRegistry.setIdentifiers( item , fullName );
|
||||
|
||||
CRegistry.addItem( item );
|
||||
|
|
|
@ -22,12 +22,34 @@ public class FMealInBowl
|
|||
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 );
|
||||
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 );
|
||||
}
|
||||
|
||||
|
||||
public FMealInBowl( int amount , float saturation , Object[] recipe )
|
||||
{
|
||||
super( amount , saturation , false );
|
||||
this.setMaxStackSize( 1 );
|
||||
|
||||
if ( recipe.length == 0 ) {
|
||||
this.recipe = null;
|
||||
|
|
|
@ -2,50 +2,22 @@ package mmm.food;
|
|||
|
||||
|
||||
import mmm.MmmFood;
|
||||
import mmm.MmmPlants;
|
||||
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 FMeals
|
||||
implements I_RecipeRegistrar
|
||||
{
|
||||
|
||||
public final FSausage SAUSAGE;
|
||||
public final FCookableMeal PASTA;
|
||||
|
||||
public final FMealInBowl TOMATO_SOUP;
|
||||
public final FMealInBowl GLOWING_SOUP;
|
||||
|
||||
public final ItemFood APPLE_PIE;
|
||||
|
||||
|
||||
public FMeals( )
|
||||
{
|
||||
CRegistry.addRegistrar( this );
|
||||
|
||||
this.SAUSAGE = new FSausage( );
|
||||
this.PASTA = new FCookableMeal( "pasta" , 2 , 0.7f , 0.5f , false , 1 , //
|
||||
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 );
|
||||
}
|
||||
|
||||
}
|
||||
|
|
34
src/java/mmm/food/FPies.java
Normal file
34
src/java/mmm/food/FPies.java
Normal 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 );
|
||||
}
|
||||
}
|
|
@ -19,7 +19,7 @@ public class FSausage
|
|||
{
|
||||
super( "sausage" , 3 , 0.7f , 1.3f , true , 4 , //
|
||||
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" );
|
||||
}
|
||||
|
||||
|
||||
|
|
20
src/java/mmm/food/FSoups.java
Normal file
20
src/java/mmm/food/FSoups.java
Normal 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( );
|
||||
}
|
||||
}
|
|
@ -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.cooked.name=Pasta
|
||||
|
||||
item.mmm.food.meal.tomato_soup.name=Tomato Soup
|
||||
item.mmm.food.meal.glowing_soup.name=Glowing Soup
|
||||
item.mmm.food.soup.tomato.name=Tomato 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
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"parent": "minecraft:item/generated",
|
||||
"textures": {
|
||||
"layer0": "mmm:items/food/meal/pie/apple"
|
||||
"layer0": "mmm:items/food/pie/apple"
|
||||
}
|
||||
}
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"parent": "minecraft:item/generated",
|
||||
"textures": {
|
||||
"layer0": "mmm:items/food/meal/tomato_soup"
|
||||
"layer0": "mmm:items/food/soup/glowing"
|
||||
}
|
||||
}
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"parent": "minecraft:item/generated",
|
||||
"textures": {
|
||||
"layer0": "mmm:items/food/meal/glowing_soup"
|
||||
"layer0": "mmm:items/food/soup/tomato"
|
||||
}
|
||||
}
|
Before Width: | Height: | Size: 335 B After Width: | Height: | Size: 335 B |
Before Width: | Height: | Size: 181 B After Width: | Height: | Size: 181 B |
Before Width: | Height: | Size: 149 B After Width: | Height: | Size: 149 B |
Reference in a new issue