diff --git a/src/java/mmm/MmmFood.java b/src/java/mmm/MmmFood.java index 356d5e2..e072eae 100644 --- a/src/java/mmm/MmmFood.java +++ b/src/java/mmm/MmmFood.java @@ -1,6 +1,7 @@ package mmm; +import mmm.food.FIngredients; import mmm.food.FMeals; import mmm.food.FMilks; @@ -9,10 +10,12 @@ import mmm.food.FMilks; public class MmmFood { public static final FMilks MILK; + public static final FIngredients INGREDIENT; public static final FMeals MEAL; static { MILK = new FMilks( ); + INGREDIENT = new FIngredients( ); MEAL = new FMeals( ); } diff --git a/src/java/mmm/food/FHelpers.java b/src/java/mmm/food/FHelpers.java new file mode 100644 index 0000000..3533f40 --- /dev/null +++ b/src/java/mmm/food/FHelpers.java @@ -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 ); + } +} diff --git a/src/java/mmm/food/FIngredients.java b/src/java/mmm/food/FIngredients.java new file mode 100644 index 0000000..5ebfb56 --- /dev/null +++ b/src/java/mmm/food/FIngredients.java @@ -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 ); + } + +} diff --git a/src/resources/assets/mmm/lang/en_US.lang b/src/resources/assets/mmm/lang/en_US.lang index 971b3ec..df8b8f5 100644 --- a/src/resources/assets/mmm/lang/en_US.lang +++ b/src/resources/assets/mmm/lang/en_US.lang @@ -144,6 +144,8 @@ item.mmm.food.milk.pig.name=Pig milk item.mmm.food.milk.horse.name=Horse 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.cooked.name=Sausage diff --git a/src/resources/assets/mmm/models/item/food/ingredient/flour.json b/src/resources/assets/mmm/models/item/food/ingredient/flour.json new file mode 100644 index 0000000..503b64f --- /dev/null +++ b/src/resources/assets/mmm/models/item/food/ingredient/flour.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "mmm:items/food/ingredient/flour" + } +} \ No newline at end of file diff --git a/src/resources/assets/mmm/textures/items/food/ingredient/flour.png b/src/resources/assets/mmm/textures/items/food/ingredient/flour.png new file mode 100644 index 0000000..e686c8e Binary files /dev/null and b/src/resources/assets/mmm/textures/items/food/ingredient/flour.png differ