- 10
- 0
Решил создать глобальный мод Nether Ores 2. Столкнулся с проблемой у меня нет предметов в кретивной вкладке. Попробовал пересоздать мир, не помогло. файлы:
Код:
ModBase:
package nor2;
import nor2.creative.tabs.TabsList;
import nor2.items.tools.ToolMaterialsList;
import nor2.subjects.blocks.BlocksList;
import nor2.subjects.items.ItemsList;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.EventHandler;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
@Mod(modid = ModInfo.MODID, name = ModInfo.NAME, version = ModInfo.VERSION)
public class ModBase {
@Mod.Instance()
public static ModBase mod;
@EventHandler
public void preload(FMLPreInitializationEvent event){
TabsList.tabs();
}
@EventHandler
public void PostInit(FMLPostInitializationEvent event) {
BlocksList.blocks();
ItemsList.items();
ToolMaterialsList.EnumToolMaterials();
}
}
Код:
package nor2.subjects.blocks;
import cpw.mods.fml.common.registry.GameRegistry;
import net.minecraft.block.Block;
import nor2.subjects.blocks.ores.end.OreCoalEnd;
import nor2.subjects.blocks.ores.end.OreDiamondEnd;
import nor2.subjects.blocks.ores.end.OreEmeraldEnd;
import nor2.subjects.blocks.ores.end.OreGoldEnd;
import nor2.subjects.blocks.ores.end.OreIronEnd;
import nor2.subjects.blocks.ores.end.OreLapizEnd;
import nor2.subjects.blocks.ores.end.mods.OreBronzeEnd;
import nor2.subjects.blocks.ores.end.mods.OreCopperEnd;
import nor2.subjects.blocks.ores.end.mods.OreEarthCrystalEnd;
import nor2.subjects.blocks.ores.end.mods.OreElectrumEnd;
import nor2.subjects.blocks.ores.end.mods.OreFlixCrystalEnd;
import nor2.subjects.blocks.ores.end.mods.OreLeadEnd;
import nor2.subjects.blocks.ores.end.mods.OreShardOfMiniumEnd;
import nor2.subjects.blocks.ores.end.mods.OreSteelEnd;
import nor2.subjects.blocks.ores.end.mods.OreTinEnd;
import nor2.subjects.blocks.ores.nether.*;
import nor2.subjects.blocks.ores.nether.mods.*;
public class BlocksList {
public static Block oreCoalNether;
public static Block oreDiamondNether;
public static Block oreEmeraldNether;
public static Block oreGoldNether;
public static Block oreIronNether;
public static Block oreLapizNether;
public static Block oreBronzeNether;
public static Block oreCopperNether;
public static Block oreEarthCrystalNether;
public static Block oreElectrumNether;
public static Block oreFlixCrystalNether;
public static Block oreLeadNether;
public static Block oreShardOfMiniumNether;
public static Block oreSteelNether;
public static Block oreTinNether;
public static Block oreCoalEnd;
public static Block oreDiamondEnd;
public static Block oreEmeraldEnd;
public static Block oreGoldEnd;
public static Block oreIronEnd;
public static Block oreLapizEnd;
public static Block oreBronzeEnd;
public static Block oreCopperEnd;
public static Block oreEarthCrystalEnd;
public static Block oreElectrumEnd;
public static Block oreFlixCrystalEnd;
public static Block oreLeadEnd;
public static Block oreShardOfMiniumEnd;
public static Block oreSteelEnd;
public static Block oreTinEnd;
public static void blocks() {
oreCoalNether = new OreCoalNether(2000).setUnlocalizedName("oreCoalNether");
oreDiamondNether = new OreDiamondNether(2001).setUnlocalizedName("oreDiamondNether");
oreEmeraldNether = new OreEmeraldNether(2002).setUnlocalizedName("oreEmeraldNether");
oreGoldNether = new OreGoldNether(2003).setUnlocalizedName("oreGoldNether");
oreIronNether = new OreIronNether(2004).setUnlocalizedName("oreIronNether");
oreLapizNether = new OreLapizNether(2005).setUnlocalizedName("oreLapizNether");
oreBronzeNether = new OreBronzeNether(2006).setUnlocalizedName("oreBronzeNether");
oreCopperNether = new OreCopperNether(2007).setUnlocalizedName("oreCopperNether");
oreEarthCrystalNether = new OreEarthCrystalNether(2008).setUnlocalizedName("oreEarthCrystalNether");
oreElectrumNether = new OreElectrumNether(2009).setUnlocalizedName("oreElectrumNether");
oreFlixCrystalNether = new OreFlixCrystalNether(2010).setUnlocalizedName("oreFlixCrystalNether");
oreLeadNether = new OreLeadNether(2011).setUnlocalizedName("oreLeadNether");
oreShardOfMiniumNether = new OreShardOfMiniumNether(2012).setUnlocalizedName("oreShardOfMiniumNether");
oreSteelNether = new OreSteelNether(2013).setUnlocalizedName("oreSteelNether");
oreTinNether = new OreTinNether(2014).setUnlocalizedName("oreTinNether");
oreCoalEnd = new OreCoalEnd(2015).setUnlocalizedName("oreCoalEnd");
oreDiamondEnd = new OreDiamondEnd(2016).setUnlocalizedName("oreDiamondEnd");
oreEmeraldEnd = new OreEmeraldEnd(2017).setUnlocalizedName("oreEmeraldEnd");
oreGoldEnd = new OreGoldEnd(2018).setUnlocalizedName("oreGoldEnd");
oreIronEnd = new OreIronEnd(2019).setUnlocalizedName("oreIronEnd");
oreLapizEnd = new OreLapizEnd(2020).setUnlocalizedName("oreLapizEnd");
oreBronzeEnd = new OreBronzeEnd(2021).setUnlocalizedName("oreBronzeEnd");
oreCopperEnd = new OreCopperEnd(2022).setUnlocalizedName("oreCopperEnd");
oreEarthCrystalEnd = new OreEarthCrystalEnd(2023).setUnlocalizedName("oreEarthCrystalEnd");
oreElectrumEnd = new OreElectrumEnd(2024).setUnlocalizedName("oreElectrumEnd");
oreFlixCrystalEnd = new OreFlixCrystalEnd(2025).setUnlocalizedName("oreFlixCrystalEnd");
oreLeadEnd = new OreLeadEnd(2026).setUnlocalizedName("oreLeadEnd");
oreShardOfMiniumEnd = new OreShardOfMiniumEnd(2027).setUnlocalizedName("oreShardOfMiniumEnd");
oreSteelEnd = new OreSteelEnd(2028).setUnlocalizedName("oreSteelEnd");
oreTinEnd = new OreTinEnd(2029).setUnlocalizedName("oreTinEnd");
GameRegistry.registerBlock(oreCoalNether);
GameRegistry.registerBlock(oreDiamondNether);
GameRegistry.registerBlock(oreEmeraldNether);
GameRegistry.registerBlock(oreGoldNether);
GameRegistry.registerBlock(oreIronNether);
GameRegistry.registerBlock(oreLapizNether);
GameRegistry.registerBlock(oreBronzeNether);
GameRegistry.registerBlock(oreCopperNether);
GameRegistry.registerBlock(oreEarthCrystalNether);
GameRegistry.registerBlock(oreElectrumNether);
GameRegistry.registerBlock(oreFlixCrystalNether);
GameRegistry.registerBlock(oreLeadNether);
GameRegistry.registerBlock(oreShardOfMiniumNether);
GameRegistry.registerBlock(oreSteelNether);
GameRegistry.registerBlock(oreTinNether);
GameRegistry.registerBlock(oreCoalEnd);
GameRegistry.registerBlock(oreDiamondEnd);
GameRegistry.registerBlock(oreEmeraldEnd);
GameRegistry.registerBlock(oreGoldEnd);
GameRegistry.registerBlock(oreIronEnd);
GameRegistry.registerBlock(oreLapizEnd);
GameRegistry.registerBlock(oreBronzeEnd);
GameRegistry.registerBlock(oreCopperEnd);
GameRegistry.registerBlock(oreEarthCrystalEnd);
GameRegistry.registerBlock(oreElectrumEnd);
GameRegistry.registerBlock(oreFlixCrystalEnd);
GameRegistry.registerBlock(oreLeadEnd);
GameRegistry.registerBlock(oreShardOfMiniumEnd);
GameRegistry.registerBlock(oreSteelEnd);
GameRegistry.registerBlock(oreTinEnd);
}
}
Код:
Пример блока:
package nor2.subjects.blocks.ores.end;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IconRegister;
import nor2.ModInfo;
public class OreCoalEnd extends Block{
public OreCoalEnd(int par1) {
super(par1, Material.rock);
this.setResistance(10.0F);
this.setHardness(2.5F);
}
@SideOnly(Side.CLIENT)
public void registerIcons(IconRegister ir)
{
this.blockIcon = ir.registerIcon(ModInfo.MODID + ":ore/nether/vanila/oreCoalEnd");
}
}
Код:
TabsList:
package nor2.creative.tabs;
import net.minecraft.creativetab.CreativeTabs;
public class TabsList {
public static CreativeTabs nor2BlocksTab;
public static void tabs() {
nor2BlocksTab = new NOr2BlocksTab(CreativeTabs.getNextID(),"nor2BlocksTab");
}
}
Код:
Вкладка:
package nor2.creative.tabs;
import net.minecraft.block.Block;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import cpw.mods.fml.relauncher.*;
public class NOr2BlocksTab extends CreativeTabs {
public NOr2BlocksTab(int position, String tabID)
{
super(position, tabID);
}
@SideOnly(Side.CLIENT)
public int getTabIconItemIndex()
{
return Block.cobblestone.blockID;
}
public String getTranslatedTabLabel()
{
return "Nether Ores Blocks";
}
}