diff --git a/graphics/jars.xcf b/graphics/jars.xcf new file mode 100644 index 0000000..53d4ff6 Binary files /dev/null and b/graphics/jars.xcf differ diff --git a/src/java/mmm/MmmFood.java b/src/java/mmm/MmmFood.java index cb4e216..a1e135e 100644 --- a/src/java/mmm/MmmFood.java +++ b/src/java/mmm/MmmFood.java @@ -2,6 +2,7 @@ package mmm; import mmm.food.FIngredients; +import mmm.food.FJams; import mmm.food.FMeals; import mmm.food.FMilks; import mmm.food.FPies; @@ -16,6 +17,7 @@ public class MmmFood public static final FMeals MEAL; public static final FPies PIE; public static final FSoups SOUP; + public static final FJams JAM; static { MILK = new FMilks( ); @@ -23,6 +25,7 @@ public class MmmFood MEAL = new FMeals( ); PIE = new FPies( ); SOUP = new FSoups( ); + JAM = new FJams( ); } diff --git a/src/java/mmm/food/FFoodInContainer.java b/src/java/mmm/food/FFoodInContainer.java new file mode 100644 index 0000000..f2a1ef4 --- /dev/null +++ b/src/java/mmm/food/FFoodInContainer.java @@ -0,0 +1,74 @@ +package mmm.food; + + +import javax.annotation.Nullable; + +import mmm.core.CRegistry; +import mmm.core.api.I_RecipeRegistrar; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.item.Item; +import net.minecraft.item.ItemFood; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; +import net.minecraftforge.fml.common.registry.GameRegistry; + + + +public class FFoodInContainer + extends ItemFood + implements I_RecipeRegistrar +{ + + private Object[] recipe; + + + public FFoodInContainer( final String section , final String name , final int amount , final float saturation , + final Item container , final int maxStackSize , final Object... recipe ) + { + super( amount , saturation , false ); + this.setMaxStackSize( maxStackSize ); + this.setContainerItem( container ); + + 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 ] = container; + } else { + this.recipe = new Object[ recipe.length + 1 ]; + System.arraycopy( recipe , 0 , this.recipe , 0 , recipe.length ); + this.recipe[ recipe.length ] = container; + } + + CRegistry.setIdentifiers( this , "food" , section , name ); + CRegistry.addItem( this ); + } + + + @Override + @Nullable + public ItemStack onItemUseFinish( final ItemStack stack , final World worldIn , + final EntityLivingBase entityLiving ) + { + super.onItemUseFinish( stack , worldIn , entityLiving ); + return new ItemStack( this.getContainerItem( ) ); + } + + + @Override + public void registerRecipes( ) + { + if ( this.recipe == null ) { + return; + } + if ( this.recipe[ 0 ] instanceof String ) { + GameRegistry.addShapedRecipe( new ItemStack( this ) , this.recipe ); + } else { + GameRegistry.addShapelessRecipe( new ItemStack( this ) , this.recipe ); + } + this.recipe = null; + } + +} diff --git a/src/java/mmm/food/FGlowingSoup.java b/src/java/mmm/food/FGlowingSoup.java index d5423e1..b547c6e 100644 --- a/src/java/mmm/food/FGlowingSoup.java +++ b/src/java/mmm/food/FGlowingSoup.java @@ -13,12 +13,12 @@ import net.minecraftforge.oredict.OreDictionary; public class FGlowingSoup - extends FMealInBowl + extends FFoodInContainer { public FGlowingSoup( ) { - super( "soup" , "glowing" , 4 , 0.6f , // + super( "soup" , "glowing" , 4 , 0.6f , Items.BOWL , 1 , // "CCC" , "CPC" , " B " , // 'C' , new ItemStack( MmmPlants.NETHER_CORAL.ITEM , 1 , OreDictionary.WILDCARD_VALUE ) , // 'P' , Items.POTATO ); diff --git a/src/java/mmm/food/FIngredients.java b/src/java/mmm/food/FIngredients.java index a237ab6..791fd24 100644 --- a/src/java/mmm/food/FIngredients.java +++ b/src/java/mmm/food/FIngredients.java @@ -4,6 +4,7 @@ package mmm.food; import mmm.MmmMaterials; import mmm.core.CRegistry; import mmm.core.api.I_RecipeRegistrar; +import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; @@ -16,6 +17,7 @@ public class FIngredients { public final Item FLOUR; public final Item DOUGH; + public final Item GLASS_JAR; public FIngredients( ) @@ -24,6 +26,7 @@ public class FIngredients this.FLOUR = FHelpers.makeIngredient( "flour" ); this.DOUGH = FHelpers.makeIngredient( "dough" ); + this.GLASS_JAR = FHelpers.makeIngredient( "glass_jar" ); } @@ -43,6 +46,17 @@ public class FIngredients GameRegistry.addShapelessRecipe( new ItemStack( this.DOUGH ) , // this.FLOUR , Items.WATER_BUCKET , MmmMaterials.ITEM.ROCK_SALT ); + + GameRegistry.addShapedRecipe( new ItemStack( GLASS_JAR , 16 ) , // + "G G" , // + "G G" , // + "GGG" , // + 'G' , Blocks.GLASS ); + GameRegistry.addShapedRecipe( new ItemStack( GLASS_JAR , 16 ) , // + "G G" , // + "G G" , // + "GGG" , // + 'G' , Blocks.STAINED_GLASS ); } } diff --git a/src/java/mmm/food/FJams.java b/src/java/mmm/food/FJams.java new file mode 100644 index 0000000..8c977c6 --- /dev/null +++ b/src/java/mmm/food/FJams.java @@ -0,0 +1,29 @@ +package mmm.food; + + +import mmm.MmmFood; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemFood; + + + +public class FJams +{ + + public final ItemFood APPLE; + + + public FJams( ) + { + this.APPLE = FJams.makeJam( "apple" , Items.APPLE ); + } + + + public static FFoodInContainer makeJam( final String name , final Item fruit ) + { + return new FFoodInContainer( "jam" , name , 5 , 0.9f , MmmFood.INGREDIENT.GLASS_JAR , 16 , // + fruit , Items.SUGAR , Items.SUGAR ); + } + +} diff --git a/src/java/mmm/food/FMealInBowl.java b/src/java/mmm/food/FMealInBowl.java deleted file mode 100644 index a7f6a9f..0000000 --- a/src/java/mmm/food/FMealInBowl.java +++ /dev/null @@ -1,91 +0,0 @@ -package mmm.food; - - -import javax.annotation.Nullable; - -import mmm.core.CRegistry; -import mmm.core.api.I_RecipeRegistrar; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.init.Items; -import net.minecraft.item.ItemFood; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import net.minecraftforge.fml.common.registry.GameRegistry; - - - -public class FMealInBowl - extends ItemFood - implements I_RecipeRegistrar -{ - - private 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 ); - - 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; - } 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; - } - } - - - @Nullable - public ItemStack onItemUseFinish( ItemStack stack , World worldIn , EntityLivingBase entityLiving ) - { - super.onItemUseFinish( stack , worldIn , entityLiving ); - return new ItemStack( Items.BOWL ); - } - - - @Override - public void registerRecipes( ) - { - if ( this.recipe == null ) { - return; - } - if ( this.recipe[ 0 ] instanceof String ) { - GameRegistry.addShapedRecipe( new ItemStack( this ) , recipe ); - } else { - GameRegistry.addShapelessRecipe( new ItemStack( this ) , recipe ); - } - this.recipe = null; - } - -} diff --git a/src/java/mmm/food/FSoups.java b/src/java/mmm/food/FSoups.java index 7e33ee9..e31f88c 100644 --- a/src/java/mmm/food/FSoups.java +++ b/src/java/mmm/food/FSoups.java @@ -2,18 +2,19 @@ package mmm.food; import mmm.MmmPlants; +import net.minecraft.init.Items; public class FSoups { - public final FMealInBowl TOMATO; - public final FMealInBowl GLOWING; + public final FFoodInContainer TOMATO; + public final FFoodInContainer GLOWING; public FSoups( ) { - this.TOMATO = new FMealInBowl( "soup" , "tomato" , 8 , 1.1f , // + this.TOMATO = new FFoodInContainer( "soup" , "tomato" , 8 , 1.1f , Items.BOWL , 1 , // "TTT" , " B " , 'T' , MmmPlants.TOMATO.FRUIT ); this.GLOWING = new FGlowingSoup( ); } diff --git a/src/resources/assets/mmm/lang/en_US.lang b/src/resources/assets/mmm/lang/en_US.lang index 35e64e2..192ceb0 100644 --- a/src/resources/assets/mmm/lang/en_US.lang +++ b/src/resources/assets/mmm/lang/en_US.lang @@ -156,6 +156,7 @@ item.mmm.food.milk.donkey.name=Donkey milk item.mmm.food.ingredient.flour.name=Wheat Flour item.mmm.food.ingredient.dough.name=Dough +item.mmm.food.ingredient.glass_jar.name=Empty Glass Jar item.mmm.food.meal.sausage.raw.name=Raw Sausage item.mmm.food.meal.sausage.cooked.name=Sausage @@ -169,6 +170,8 @@ item.mmm.food.soup.glowing.name=Glowing Soup item.mmm.food.pie.apple.name=Apple Pie +item.mmm.food.jam.apple.name=Apple Jam + tile.mmm.deco.smoothstone.limestone.name=Polished Limestone tile.mmm.deco.smoothstone.basalt.name=Polished Basalt diff --git a/src/resources/assets/mmm/models/item/food/ingredient/glass_jar.json b/src/resources/assets/mmm/models/item/food/ingredient/glass_jar.json new file mode 100644 index 0000000..5383abe --- /dev/null +++ b/src/resources/assets/mmm/models/item/food/ingredient/glass_jar.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "mmm:items/food/ingredient/glass_jar" + } +} \ No newline at end of file diff --git a/src/resources/assets/mmm/models/item/food/jam/apple.json b/src/resources/assets/mmm/models/item/food/jam/apple.json new file mode 100644 index 0000000..09d8323 --- /dev/null +++ b/src/resources/assets/mmm/models/item/food/jam/apple.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "mmm:items/food/jam/apple" + } +} \ No newline at end of file diff --git a/src/resources/assets/mmm/textures/items/food/ingredient/glass_jar.png b/src/resources/assets/mmm/textures/items/food/ingredient/glass_jar.png new file mode 100644 index 0000000..f37f283 Binary files /dev/null and b/src/resources/assets/mmm/textures/items/food/ingredient/glass_jar.png differ diff --git a/src/resources/assets/mmm/textures/items/food/jam/apple.png b/src/resources/assets/mmm/textures/items/food/jam/apple.png new file mode 100644 index 0000000..6a0adee Binary files /dev/null and b/src/resources/assets/mmm/textures/items/food/jam/apple.png differ