diff --git a/graphics/tomato.xcf b/graphics/tomato.xcf new file mode 100644 index 0000000..914e4d3 Binary files /dev/null and b/graphics/tomato.xcf differ diff --git a/src/java/mmm/MmmPlants.java b/src/java/mmm/MmmPlants.java new file mode 100644 index 0000000..12bde10 --- /dev/null +++ b/src/java/mmm/MmmPlants.java @@ -0,0 +1,23 @@ +package mmm; + + +import mmm.plants.PTomato; + + + +public class MmmPlants +{ + + public static final PTomato TOMATO; + + static { + TOMATO = new PTomato( ); + } + + + public static void preInit( ) + { + // EMPTY + } + +} diff --git a/src/java/mmm/core/CProxyCommon.java b/src/java/mmm/core/CProxyCommon.java index ff54c36..5e6945b 100644 --- a/src/java/mmm/core/CProxyCommon.java +++ b/src/java/mmm/core/CProxyCommon.java @@ -4,6 +4,7 @@ package mmm.core; import mmm.MmmDeco; import mmm.MmmFood; import mmm.MmmMaterials; +import mmm.MmmPlants; import mmm.MmmTech; import mmm.MmmWorld; import mmm.recipes.RCraftingWrappers; @@ -21,6 +22,7 @@ public class CProxyCommon RCraftingWrappers.preInit( ); CAccessors.preInit( ); + MmmPlants.preInit( ); MmmMaterials.preInit( ); MmmWorld.preInit( ); MmmTech.preInit( ); diff --git a/src/java/mmm/plants/PPlantsHelper.java b/src/java/mmm/plants/PPlantsHelper.java new file mode 100644 index 0000000..1cc98b4 --- /dev/null +++ b/src/java/mmm/plants/PPlantsHelper.java @@ -0,0 +1,32 @@ +package mmm.plants; + + +import mmm.core.CRegistry; +import net.minecraft.block.Block; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemFood; +import net.minecraft.item.ItemSeeds; + + + +public class PPlantsHelper +{ + + public static ItemFood makeFruit( final String name , final int food , final float saturation ) + { + final ItemFood fruit = new ItemFood( food , saturation , false ); + CRegistry.setIdentifiers( fruit , "plant" , "fruit" , name ); + CRegistry.addItem( fruit ); + return fruit; + } + + + public static ItemSeeds makeSeeds( final String name , final Block plant ) + { + final ItemSeeds seeds = new ItemSeeds( plant , Blocks.FARMLAND ); + CRegistry.setIdentifiers( seeds , "plant" , "seeds" , name ); + CRegistry.addItem( seeds ); + return seeds; + } + +} diff --git a/src/java/mmm/plants/PTomato.java b/src/java/mmm/plants/PTomato.java new file mode 100644 index 0000000..3f0781d --- /dev/null +++ b/src/java/mmm/plants/PTomato.java @@ -0,0 +1,65 @@ +package mmm.plants; + + +import mmm.core.CRegistry; +import mmm.core.api.I_RecipeRegistrar; +import net.minecraft.block.BlockCrops; +import net.minecraft.item.Item; +import net.minecraft.item.ItemFood; +import net.minecraft.item.ItemSeeds; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fml.common.registry.GameRegistry; + + + +public class PTomato + implements I_RecipeRegistrar +{ + + public class Plant + extends BlockCrops + { + + public Plant( ) + { + CRegistry.setIdentifiers( this , "plant" , "block" , "tomato" ); + } + + + @Override + protected Item getSeed( ) + { + return PTomato.this.SEEDS; + } + + + @Override + protected Item getCrop( ) + { + return PTomato.this.FRUIT; + } + + } + + public final ItemSeeds SEEDS; + public final Plant PLANT; + public final ItemFood FRUIT; + + + public PTomato( ) + { + CRegistry.addBlock( this.PLANT = new Plant( ) , null ); + this.SEEDS = PPlantsHelper.makeSeeds( "tomato" , this.PLANT ); + this.FRUIT = PPlantsHelper.makeFruit( "tomato" , 2 , .15f ); + CRegistry.addRecipeRegistrar( this ); + } + + + @Override + public void registerRecipes( ) + { + GameRegistry.addShapelessRecipe( new ItemStack( this.SEEDS , 4 ) , // + new ItemStack( this.FRUIT ) ); + } + +} diff --git a/src/resources/assets/mmm/lang/en_US.lang b/src/resources/assets/mmm/lang/en_US.lang index babaa13..b8322ed 100644 --- a/src/resources/assets/mmm/lang/en_US.lang +++ b/src/resources/assets/mmm/lang/en_US.lang @@ -8,6 +8,10 @@ gui.mmm.tech.base.am.unpowered=Redstone Disables gui.mmm.tech.base.am.disabled=Deactivated +item.mmm.plant.fruit.tomato.name=Tomato +item.mmm.plant.seeds.tomato.name=Tomato Seeds + + tile.mmm.materials.rock.limestone.name=Limestone tile.mmm.materials.rock.chalk.name=Chalk tile.mmm.materials.rock.slate.name=Slate diff --git a/src/resources/assets/mmm/models/item/plant/fruit/tomato.json b/src/resources/assets/mmm/models/item/plant/fruit/tomato.json new file mode 100644 index 0000000..9efd18b --- /dev/null +++ b/src/resources/assets/mmm/models/item/plant/fruit/tomato.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "mmm:items/plant/fruit/tomato" + } +} \ No newline at end of file diff --git a/src/resources/assets/mmm/models/item/plant/seeds/tomato.json b/src/resources/assets/mmm/models/item/plant/seeds/tomato.json new file mode 100644 index 0000000..777ccea --- /dev/null +++ b/src/resources/assets/mmm/models/item/plant/seeds/tomato.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "mmm:items/plant/seeds/tomato" + } +} \ No newline at end of file diff --git a/src/resources/assets/mmm/textures/items/plant/fruit/tomato.png b/src/resources/assets/mmm/textures/items/plant/fruit/tomato.png new file mode 100644 index 0000000..688996d Binary files /dev/null and b/src/resources/assets/mmm/textures/items/plant/fruit/tomato.png differ diff --git a/src/resources/assets/mmm/textures/items/plant/seeds/tomato.png b/src/resources/assets/mmm/textures/items/plant/seeds/tomato.png new file mode 100644 index 0000000..b17f2e9 Binary files /dev/null and b/src/resources/assets/mmm/textures/items/plant/seeds/tomato.png differ