- 23
- 0
Всем привет помогите мне понять что я не так делаю. Я знаю как мою проблему исправить чтобы когда я садил семя и не вылетало но при этом с растения ничего не выпадает. Мне нужно зарегистрировать предмет и блок растения так чтобы я смог посадить это растение и выпадало то что мне нужно.
Вот главный класс:
Вот главный класс:
Код:
package assets.farmthings;
import assets.farmthings.block.WorldGeneratorCrystal;
import assets.farmthings.crops.BlockCropMod;
import assets.farmthings.init.ModTabs;
import assets.farmthings.item.ItemEssence;
import assets.farmthings.item.ItemSeed;
import assets.farmthings.item.ItemTab;
import assets.farmthings.item.MyItems;
import cpw.mods.fml.common.Loader;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.EventHandler;
import cpw.mods.fml.common.Mod.Instance;
import cpw.mods.fml.common.SidedProxy;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.network.NetworkRegistry;
import cpw.mods.fml.common.registry.GameRegistry;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
@Mod(modid = farmthings.MODID, name = farmthings.MODNAME, version = farmthings.VERSION)
public class farmthings {
public static final String MODID = "farmthings";
public static final String MODNAME = "Farm Things";
public static final String VERSION = "0.0.1";
public static WorldGeneratorCrystal blockgenerator = new WorldGeneratorCrystal();
public static Item tabItem;
@Instance(MODID)
public static farmthings instance;
//Seeds
public static ItemSeed seedIron;
public static ItemSeed seedGold;
//Essence
public static ItemEssence essenceIron;
public static ItemEssence essenceGold;
//Crops
public static Block cropIron;
public static Block cropGold;
//Blocks
public static Block CrystalOreBlue;
public static Block CrystalOreYellowRed;
//Items
public static MyItems CrystalBlue;
public static MyItems PowdercrystalBlue;
public static MyItems CrystalYellowRed;
public static MyItems PowdercrystalYellowRed;
@EventHandler
public void preInit(FMLPreInitializationEvent preEvent){
ModTabs.load();
}
@EventHandler
public void init(FMLInitializationEvent event){
}
@EventHandler
public void postInit(FMLPostInitializationEvent event) {
GameRegistry.registerWorldGenerator(blockgenerator, 0);
// Filling Seeds:
seedIron = new ItemSeed("Iron", cropIron);
seedGold = new ItemSeed("Gold", cropGold);
// Registering Seeds:
if(seedIron != null) RegistrationHelper.registerItem(seedIron);
if(seedGold != null) RegistrationHelper.registerItem(seedGold);
// Filling Essences:
essenceIron = new ItemEssence("Iron");
essenceGold = new ItemEssence("Gold");
// Registering Essences:
if(essenceIron != null) RegistrationHelper.registerItem(essenceIron);
if(essenceGold != null) RegistrationHelper.registerItem(essenceGold);
// Filling Crops:
cropIron = new BlockCropMod("Iron", seedIron, essenceIron);
cropGold = new BlockCropMod("Gold", seedGold, essenceGold);
// Registering Crops:
if(cropIron != null) RegistrationHelper.registerBlock(cropIron);
if(cropGold !=null) RegistrationHelper.registerBlock(cropGold);
//Items
CrystalBlue = new MyItems("CrystalBlue");
PowdercrystalBlue = new MyItems("PowdercrystalBlue");
CrystalYellowRed = new MyItems("CrystalYellowRed");
PowdercrystalYellowRed = new MyItems("PowdercrystalYellowRed");
//Register Items
if(CrystalBlue != null) RegistrationHelper.registerItem(CrystalBlue);
if(PowdercrystalBlue != null) RegistrationHelper.registerItem(PowdercrystalBlue);
if(CrystalYellowRed != null) RegistrationHelper.registerItem(CrystalYellowRed);
if(PowdercrystalYellowRed != null) RegistrationHelper.registerItem(PowdercrystalYellowRed);
//Blocks
CrystalOreBlue= new assets.farmthings.block.CrystalOreBlue("CrystalBlue", Material.rock ,farmthings.PowdercrystalBlue, 2, 4, 0);
CrystalOreYellowRed= new assets.farmthings.block.CrystalOreYellowRed("CrystalYellowRed", Material.rock, farmthings.PowdercrystalYellowRed, 2, 4, 0);
//RegisterBlocks
if(CrystalOreBlue !=null) RegistrationHelper.registerBlock(CrystalOreBlue);
if(CrystalOreYellowRed !=null) RegistrationHelper.registerBlock(CrystalOreYellowRed);
//Machine
//RegisterMachine
Recipes.registerRecipes();
tabItem = new ItemTab();
if(tabItem != null) RegistrationHelper.registerItem(tabItem);
}
}