From 8639b91717b47fde799528c1779ddea54bcd2c1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emmanuel=20Beno=C3=AEt?= Date: Thu, 21 Jul 2016 20:10:19 +0200 Subject: [PATCH] Dried sausage --- graphics/sausage.xcf | Bin 2053 -> 3629 bytes src/java/mmm/food/FHelpers.java | 17 +++++++++ src/java/mmm/food/FMeals.java | 6 ++-- src/java/mmm/food/FSausage.java | 33 ++++++++++++++++++ src/resources/assets/mmm/lang/en_US.lang | 1 + .../models/item/food/meal/sausage/dried.json | 6 ++++ .../items/food/meal/sausage/dried.png | Bin 0 -> 419 bytes 7 files changed, 59 insertions(+), 4 deletions(-) create mode 100644 src/java/mmm/food/FSausage.java create mode 100644 src/resources/assets/mmm/models/item/food/meal/sausage/dried.json create mode 100644 src/resources/assets/mmm/textures/items/food/meal/sausage/dried.png diff --git a/graphics/sausage.xcf b/graphics/sausage.xcf index 627270b43df350dd7a042d9f2e6708f373063d78..ad468ade621630f5e2c8766b299b24e0d02d012c 100644 GIT binary patch literal 3629 zcmd^AO>Y}j6rDE{$4&yGh%fPB$yp?7g#xW)i3Rc^1U8v$rrku!%1vz7!i}vs1Bs<< zkh%Z~T8V&=qP7&eaHLpaky29G{SYlp%K(L>sw$ODBqaX>+Innr&YKxDL+u?%m3Y#f zIp^MY-aGT|jGf6IEyNb4)3J0mmr^kHxIz3hLI_-*K}6mDM?b>D13vtO4?pR{PXTjXZ-fCnz5f+(>*_%l zc#nX&YC4!x-y?rXQLO=`$Ld!!t9285XjXIUsuJe?`W1P%zrR?+18SCi{gMl|E^j)S ztxKCq2y*-K<~ab(YFynsw}G0l9&TMZzp;T89$42epGUG!v9Dp)i~plN?R$6bpw|yC z{;_D?zyUnG^7+ba8mIi=%*n~sg^zhUxnsBPo_+`D{;|*Q-ro4~b)4S)+;7#}H@|*^ z@Vjp=oc_@~LwM@2l(ul%N&Mq%!@O-k~C@+JA93sk1KM~8&^mwHXOv6@cMU-Vp*6E}tiLExT53^n~k3_^pA zol*w|_qqy|EWy1#+=T@ffqQ*;XlPK%=m|(9;2r_@Mr(}jjR`RU1oy^-MueHn+2f;Q zbWhwE9|eJX5;5NN6EO-6Hg-xK7~C5wRI&v3#zYquTm}O#|Bf{A+XKz~t_LI1=ZGoVlBx1YiC&GdT zt#C>m82VXIp^_!^v#`^J1s6d-3p?A}mXy&GkSNf!>}MR-<4a zoYsjOr4$IPlZaB&PeckD?CO*{Fj$YPP{|Uk$CtXW;3BXdUn-SSQbtceA`a^aT%)ia zof1>6D6L1QG$Kr6&Yny}X`Q$+nE-)x5;58I6On)hyE>%~4A!G6RI&u?(Wx#hxCpFA zrzR&8QbtceB1+T$!B^CCF!?^;#K++i(rCmP1FJ6Z{UZ(3g1Ld8$Z;+vnrYTWy=AhQ zW?dt~!I^cn-rP0WOG2@WG+N0COuJB~(E+9(!Dyk`nc>T1kd_< z7ZzLuFP*+#sjNsDJplm;Ju^b@fL n4R&=(9T=<|Dpaxr>qe~$3oZidMy*<1lQMb&5(Z8G8{f-cD_OKJ delta 126 zcmZ20(<(5*j*(@fy)`3GI|BpDSq2E0yp4U88j~56Cjg{Dn1z9X$qQACDQa^YM;{Xl e6Hs`v0QY1y)<#qXAWf`OQN>u7Za&GK!UO;~(holX diff --git a/src/java/mmm/food/FHelpers.java b/src/java/mmm/food/FHelpers.java index 3533f40..b83f678 100644 --- a/src/java/mmm/food/FHelpers.java +++ b/src/java/mmm/food/FHelpers.java @@ -4,6 +4,7 @@ package mmm.food; import mmm.core.CRegistry; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; +import net.minecraft.item.ItemFood; import net.minecraft.item.ItemStack; import net.minecraftforge.fml.common.registry.GameRegistry; @@ -12,6 +13,22 @@ import net.minecraftforge.fml.common.registry.GameRegistry; public class FHelpers { + public static ItemFood makeBasicMeal( int amount , float saturation , boolean wolfFood , String... name ) + { + final ItemFood item = new ItemFood( amount , saturation , wolfFood ); + item.setCreativeTab( CreativeTabs.FOOD ); + + String[] fullName = new String[ name.length + 2 ]; + fullName[ 0 ] = "food"; + fullName[ 1 ] = "meal"; + System.arraycopy( name , 0 , fullName , 2 , name.length ); + CRegistry.setIdentifiers( item , fullName ); + + CRegistry.addItem( item ); + return item; + } + + public static Item makeIngredient( final String name ) { final Item item = new Item( ); diff --git a/src/java/mmm/food/FMeals.java b/src/java/mmm/food/FMeals.java index 5a3927f..5cd25dd 100644 --- a/src/java/mmm/food/FMeals.java +++ b/src/java/mmm/food/FMeals.java @@ -2,7 +2,6 @@ package mmm.food; import mmm.MmmFood; -import mmm.MmmMaterials; import mmm.MmmPlants; import net.minecraft.init.Items; @@ -11,7 +10,7 @@ import net.minecraft.init.Items; public class FMeals { - public final FCookableMeal SAUSAGE; + public final FSausage SAUSAGE; public final FCookableMeal PASTA; public final FMealInBowl TOMATO_SOUP; public final FMealInBowl GLOWING_SOUP; @@ -19,8 +18,7 @@ public class FMeals public FMeals( ) { - this.SAUSAGE = new FCookableMeal( "sausage" , 3 , 0.7f , 1.3f , true , 4 , // - Items.PORKCHOP , MmmMaterials.ITEM.ROCK_SALT , Items.LEATHER ); + 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 , // diff --git a/src/java/mmm/food/FSausage.java b/src/java/mmm/food/FSausage.java new file mode 100644 index 0000000..6f944e5 --- /dev/null +++ b/src/java/mmm/food/FSausage.java @@ -0,0 +1,33 @@ +package mmm.food; + + +import mmm.MmmMaterials; +import net.minecraft.init.Items; +import net.minecraft.item.ItemFood; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fml.common.registry.GameRegistry; + + + +public class FSausage + extends FCookableMeal +{ + public final ItemFood DRIED; + + + public 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" ); + } + + + @Override + public void registerRecipes( ) + { + super.registerRecipes( ); + GameRegistry.addShapelessRecipe( new ItemStack( this.DRIED ) , this.RAW , MmmMaterials.ITEM.SALTPETER ); + } + +} diff --git a/src/resources/assets/mmm/lang/en_US.lang b/src/resources/assets/mmm/lang/en_US.lang index 6feb718..87bc1b7 100644 --- a/src/resources/assets/mmm/lang/en_US.lang +++ b/src/resources/assets/mmm/lang/en_US.lang @@ -158,6 +158,7 @@ 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 +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 diff --git a/src/resources/assets/mmm/models/item/food/meal/sausage/dried.json b/src/resources/assets/mmm/models/item/food/meal/sausage/dried.json new file mode 100644 index 0000000..e17e289 --- /dev/null +++ b/src/resources/assets/mmm/models/item/food/meal/sausage/dried.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "mmm:items/food/meal/sausage/dried" + } +} \ No newline at end of file diff --git a/src/resources/assets/mmm/textures/items/food/meal/sausage/dried.png b/src/resources/assets/mmm/textures/items/food/meal/sausage/dried.png new file mode 100644 index 0000000000000000000000000000000000000000..625f80daef2cd8bc0a2cdccae48ae972d22b0948 GIT binary patch literal 419 zcmV;U0bKrxP)<>FiY z(n(kf^dz(V{yB4I#%8ln7aQ9!m(#umo7FPmMCoGk*(S?Uh>3@}3Vzi-R8JTq=?f#F zzI+G?C{&?^lF%Y4v`=Y>N516(OsvN;(3v#a4nMSK9@Vn|Wa@5lfQh?q8okRH# zKW{}CSrPpxi$O_-;G$3oF#qG(BheX_+;>0tf>EUbjVnQ6^ANl@^YOPUfZo*u8J3YL zlWD6(2@(~CNJr;mb694(g9J}HXnDhAS21vp%=*FNGwX2