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:
parent
64ae8edb64
commit
ff50b6bf19
10 changed files with 138 additions and 0 deletions
BIN
graphics/tomato.xcf
Normal file
BIN
graphics/tomato.xcf
Normal file
Binary file not shown.
23
src/java/mmm/MmmPlants.java
Normal file
23
src/java/mmm/MmmPlants.java
Normal 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
|
||||
}
|
||||
|
||||
}
|
|
@ -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( );
|
||||
|
|
32
src/java/mmm/plants/PPlantsHelper.java
Normal file
32
src/java/mmm/plants/PPlantsHelper.java
Normal 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;
|
||||
}
|
||||
|
||||
}
|
65
src/java/mmm/plants/PTomato.java
Normal file
65
src/java/mmm/plants/PTomato.java
Normal 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 ) );
|
||||
}
|
||||
|
||||
}
|
|
@ -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
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"parent": "minecraft:item/generated",
|
||||
"textures": {
|
||||
"layer0": "mmm:items/plant/fruit/tomato"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"parent": "minecraft:item/generated",
|
||||
"textures": {
|
||||
"layer0": "mmm:items/plant/seeds/tomato"
|
||||
}
|
||||
}
|
BIN
src/resources/assets/mmm/textures/items/plant/fruit/tomato.png
Normal file
BIN
src/resources/assets/mmm/textures/items/plant/fruit/tomato.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 461 B |
BIN
src/resources/assets/mmm/textures/items/plant/seeds/tomato.png
Normal file
BIN
src/resources/assets/mmm/textures/items/plant/seeds/tomato.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 140 B |
Reference in a new issue