From ff9bf5d16c96627e4842656742bfeca1272ff90d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emmanuel=20Beno=C3=AEt?= Date: Thu, 21 Jul 2016 09:55:41 +0200 Subject: [PATCH] Wheat flour --- src/java/mmm/MmmFood.java | 3 ++ src/java/mmm/food/FHelpers.java | 47 ++++++++++++++++++ src/java/mmm/food/FIngredients.java | 32 ++++++++++++ src/resources/assets/mmm/lang/en_US.lang | 2 + .../models/item/food/ingredient/flour.json | 6 +++ .../textures/items/food/ingredient/flour.png | Bin 0 -> 187 bytes 6 files changed, 90 insertions(+) create mode 100644 src/java/mmm/food/FHelpers.java create mode 100644 src/java/mmm/food/FIngredients.java create mode 100644 src/resources/assets/mmm/models/item/food/ingredient/flour.json create mode 100644 src/resources/assets/mmm/textures/items/food/ingredient/flour.png 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 0000000000000000000000000000000000000000..e686c8eedf261e9c3159e6f03f9fd649cfa8c805 GIT binary patch literal 187 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`O`a}}Ar_~T6C~~(xU2ibo@4Ub zpQoo+|6d<_(_xpQ!C3=l4