Tomato - Started work

The tomatoes and their seeds are done. The plant is textureless and
doesn't work as it should.
This commit is contained in:
Emmanuel BENOîT 2016-07-18 17:27:39 +02:00
parent 64ae8edb64
commit ff50b6bf19
10 changed files with 138 additions and 0 deletions

BIN
graphics/tomato.xcf Normal file

Binary file not shown.

View file

@ -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
}
}

View file

@ -4,6 +4,7 @@ package mmm.core;
import mmm.MmmDeco; import mmm.MmmDeco;
import mmm.MmmFood; import mmm.MmmFood;
import mmm.MmmMaterials; import mmm.MmmMaterials;
import mmm.MmmPlants;
import mmm.MmmTech; import mmm.MmmTech;
import mmm.MmmWorld; import mmm.MmmWorld;
import mmm.recipes.RCraftingWrappers; import mmm.recipes.RCraftingWrappers;
@ -21,6 +22,7 @@ public class CProxyCommon
RCraftingWrappers.preInit( ); RCraftingWrappers.preInit( );
CAccessors.preInit( ); CAccessors.preInit( );
MmmPlants.preInit( );
MmmMaterials.preInit( ); MmmMaterials.preInit( );
MmmWorld.preInit( ); MmmWorld.preInit( );
MmmTech.preInit( ); MmmTech.preInit( );

View file

@ -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;
}
}

View file

@ -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 ) );
}
}

View file

@ -8,6 +8,10 @@ gui.mmm.tech.base.am.unpowered=Redstone Disables
gui.mmm.tech.base.am.disabled=Deactivated 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.limestone.name=Limestone
tile.mmm.materials.rock.chalk.name=Chalk tile.mmm.materials.rock.chalk.name=Chalk
tile.mmm.materials.rock.slate.name=Slate tile.mmm.materials.rock.slate.name=Slate

View file

@ -0,0 +1,6 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "mmm:items/plant/fruit/tomato"
}
}

View file

@ -0,0 +1,6 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "mmm:items/plant/seeds/tomato"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 461 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 140 B