Wheat flour

This commit is contained in:
Emmanuel BENOîT 2016-07-21 09:55:41 +02:00
parent 170992ecba
commit ff9bf5d16c
6 changed files with 90 additions and 0 deletions

View file

@ -1,6 +1,7 @@
package mmm; package mmm;
import mmm.food.FIngredients;
import mmm.food.FMeals; import mmm.food.FMeals;
import mmm.food.FMilks; import mmm.food.FMilks;
@ -9,10 +10,12 @@ import mmm.food.FMilks;
public class MmmFood public class MmmFood
{ {
public static final FMilks MILK; public static final FMilks MILK;
public static final FIngredients INGREDIENT;
public static final FMeals MEAL; public static final FMeals MEAL;
static { static {
MILK = new FMilks( ); MILK = new FMilks( );
INGREDIENT = new FIngredients( );
MEAL = new FMeals( ); MEAL = new FMeals( );
} }

View file

@ -0,0 +1,47 @@
package mmm.food;
import mmm.core.CRegistry;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fml.common.registry.GameRegistry;
public class FHelpers
{
public static Item makeIngredient( final String name )
{
final Item item = new Item( );
item.setCreativeTab( CreativeTabs.FOOD );
CRegistry.setIdentifiers( item , "food" , "ingredient" , name );
CRegistry.addItem( item );
return item;
}
public static void addCooking( final Item in , final Item out )
{
FHelpers.addCooking( in , out , 1 );
}
public static void addCooking( final Item in , final Item out , final int amount )
{
GameRegistry.addSmelting( in , new ItemStack( out , amount ) , 0.1f );
}
public static void addTransform( final Item in , final Item out )
{
FHelpers.addTransform( in , out , 1 );
}
public static void addTransform( final Item in , final Item out , final int amount )
{
GameRegistry.addShapelessRecipe( new ItemStack( out , amount ) , in );
}
}

View file

@ -0,0 +1,32 @@
package mmm.food;
import mmm.core.CRegistry;
import mmm.core.api.I_RecipeRegistrar;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
public class FIngredients
implements I_RecipeRegistrar
{
public final Item FLOUR;
public FIngredients( )
{
CRegistry.addRegistrar( this );
this.FLOUR = FHelpers.makeIngredient( "flour" );
}
@Override
public void registerRecipes( )
{
FHelpers.addTransform( Items.WHEAT , this.FLOUR );
FHelpers.addCooking( this.FLOUR , Items.BREAD );
}
}

View file

@ -144,6 +144,8 @@ item.mmm.food.milk.pig.name=Pig milk
item.mmm.food.milk.horse.name=Horse milk item.mmm.food.milk.horse.name=Horse milk
item.mmm.food.milk.donkey.name=Donkey milk item.mmm.food.milk.donkey.name=Donkey milk
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

View file

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 187 B