Jump to content

LaughingJackalMC

Members
  • Posts

    31
  • Joined

  • Last visited

Everything posted by LaughingJackalMC

  1. This actually doesn't matter @OP: In which order do you instantiate the item and creativetab? Sounds to me you instantiate the item first and then the creativetab. We can't tell for sure as long as you don't show us your main mod file. package me.irule2222.stuffmod; import me.irule2222.suffmod.worldgen.ElderOreWG; import net.minecraft.block.Block; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; import net.minecraft.item.Item.ToolMaterial; import net.minecraft.item.ItemArmor.ArmorMaterial; import net.minecraft.item.ItemStack; import net.minecraftforge.common.util.EnumHelper; import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.Mod.EventHandler; import cpw.mods.fml.common.event.FMLPreInitializationEvent; import cpw.mods.fml.common.registry.GameRegistry; /** * */ @Mod(modid = StuffMain.name, version = StuffMain.version) public class StuffMain { //*create the base for things*\\ public static final String modid = "StuffMod"; public static final String version = "Pre Alpha 0.1.0"; public static final String name = "Stuff Mod"; public static int helmetId; public static int chestplateId; public static int legginsId; public static int bootsId; public static Block RottenWood; public static Block ElderOre; public static Block poo; public static Item DigestedMush; public static Item RottenFlakes; public static Item ElderIngot; public static ToolMaterial Eldert = EnumHelper.addToolMaterial("Eldert", 3, 99999, 12.0f, 90.0f, 10); public static ToolMaterial Redstone = EnumHelper.addToolMaterial("Redstone", 1, 200, 6.0f, 5.0f, 10); public static ArmorMaterial Elder = EnumHelper.addArmorMaterial("Elder", 99, new int [] {6, 16 ,12 ,6}, 10); //public static ToolMaterial test = EnumHelper.addToolMaterial(name, harvestLevel, maxUses, efficiency, damage, enchantability) //public static Armormaterial test = EnumHelper.addArmorMaterial(name, durability, reductionAmounts, enchantability) public static Item ElderSword; public static Item RedstoneSword; public static Item RedstonePickaxe; public static Item RedstoneHoe; public static Item RedstoneShovel; public static Item RedstoneAxe; public static Block ElderBlock; public static Item ElderHelmet = new ElderArmour(Elder, helmetId, 0).setUnlocalizedName("ElderHelmet"); public static Item ElderChestplate = new ElderArmour(Elder, chestplateId, 1).setUnlocalizedName("ElderChestplate"); public static Item ElderLeggins = new ElderArmour(Elder, legginsId, 2).setUnlocalizedName("ElderLeggins"); public static Item ElderBoots = new ElderArmour(Elder, bootsId, 3).setUnlocalizedName("Elderboots"); public static ElderOreWG worldgen1 = new ElderOreWG(); public static CreativeTabs StuffMod = new CreativeTabs("StuffMod"){ public Item getTabIconItem() { return Item.getItemFromBlock(StuffMain.ElderOre); } }; //register things @EventHandler public void preinit(FMLPreInitializationEvent e){ GameRegistry.registerItem(ElderHelmet, "ElderHelmet"); GameRegistry.registerItem(ElderChestplate, "ElderChestplate"); GameRegistry.registerItem(ElderLeggins, "ElderLeggins"); GameRegistry.registerItem(ElderBoots, "ElderBoots"); //ROttenFlakes RottenFlakes = new Item().setUnlocalizedName("RottenFlakes").setCreativeTab(StuffMod).setTextureName(modid + ":" + "RottenFlakes").setFull3D(); GameRegistry.registerItem(RottenFlakes, "RottenFlakes"); //ElderIngot ElderIngot = new Item().setUnlocalizedName("ElderIngot").setCreativeTab(StuffMod).setFull3D().setTextureName(modid + ":" + "ElderIngot"); GameRegistry.registerItem(ElderIngot, "ElderIngot"); //rottenwood RottenWood = new RottenWood().setBlockName("RottenWood").setCreativeTab(StuffMod).setHardness(0).setBlockTextureName(modid + ":" + "RottenWood"); GameRegistry.registerBlock(RottenWood, "RottenWood"); //Elder Block ElderBlock = new ElderBlock().setBlockName("ElderBlock").setCreativeTab(StuffMod).setHardness(10.0f).setResistance(10.0f); GameRegistry.registerBlock(ElderBlock, "ElderBlock"); //poo poo = new Poo().setBlockName("Poo").setCreativeTab(StuffMod).setHardness(0).setBlockTextureName(modid + ":" + "poo"); GameRegistry.registerBlock(poo, "Poo"); //Digested Mush DigestedMush = new Item().setUnlocalizedName("DigestedMush").setCreativeTab(StuffMod).setTextureName(modid + ":" + "DGMSH"); GameRegistry.registerItem(DigestedMush, "DigestedMush"); //world generation GameRegistry.registerWorldGenerator(worldgen1, 1); //tools ElderSword = new ElderSwordClass().setUnlocalizedName("ElderSword"); GameRegistry.registerItem(ElderSword, "ElderSword"); RedstoneSword = new RedstoneSwordClass().setUnlocalizedName("RedstoneSword"); GameRegistry.registerItem(RedstoneSword, "RedstoneSword"); RedstonePickaxe = new RedstonePickaxeClass().setUnlocalizedName("RedstonePickaxe"); GameRegistry.registerItem(RedstonePickaxe, "RedstonePickaxe"); RedstoneHoe = new RedstoneHoeClass().setUnlocalizedName("RedstoneHoe"); GameRegistry.registerItem(RedstoneHoe, "RedstoneHoe"); RedstoneShovel = new RedstoneShovelClass().setUnlocalizedName("RedstoneShovel"); GameRegistry.registerItem(RedstoneShovel, "RedstoneShovel"); RedstoneAxe = new RedstoneAxeClass().setUnlocalizedName("RedstoneAxe"); GameRegistry.registerItem(RedstoneAxe, "RedstoneAxe"); //Armour //Elder Ore ElderOre = new ElderOre().setBlockName("ElderOre").setCreativeTab(StuffMod).setHardness(5f).setResistance(7.0f).setBlockTextureName(modid + ":" + "ElderOre"); GameRegistry.registerBlock(ElderOre, "ElderOre"); //wood biome //WoodBiome = new BiomeGenWoodBiome(137).setBiomeName("Wood Land"); //BiomeDictionary.registerBiomeType(WoodBiome); // BiomeManager.addSpawnBiome(WoodBiome); //Crafting Recepies GameRegistry.addRecipe(new ItemStack(ElderSword, 1), new Object [] { " E ", "EEE", " S ", 'E', ElderIngot, 'S', Item.itemRegistry.getObject("stick")}); GameRegistry.addRecipe(new ItemStack(ElderBlock, 1), new Object [] { "EEE", "EEE", "EEE", 'E', ElderIngot}); GameRegistry.addRecipe(new ItemStack(RedstoneSword, 1), new Object [] { " R ", " R ", " S ", 'R', Item.itemRegistry.getObject("redstone"), 'S', Item.itemRegistry.getObject("stick") }); GameRegistry.addRecipe(new ItemStack(RedstonePickaxe, 1), new Object [] { "RRR", " S ", " S ", 'R', Item.itemRegistry.getObject("redstone"), 'S', Item.itemRegistry.getObject("stick") }); GameRegistry.addRecipe(new ItemStack(RedstoneShovel, 1), new Object [] { " R ", " S ", " S ", 'R', Item.itemRegistry.getObject("redstone"), 'S', Item.itemRegistry.getObject("stick") }); GameRegistry.addRecipe(new ItemStack(RedstoneAxe, 1), new Object [] { "RR ", "RS ", " S ", 'R', Item.itemRegistry.getObject("redstone"), 'S', Item.itemRegistry.getObject("stick") }); GameRegistry.addRecipe(new ItemStack(RedstoneHoe, 1), new Object [] { "RR ", " S ", " S ", 'R', Item.itemRegistry.getObject("redstone"), 'S', Item.itemRegistry.getObject("stick") }); GameRegistry.addRecipe(new ItemStack(ElderHelmet, 1), new Object [] {"EEE","E E", " ", 'E', ElderIngot}); GameRegistry.addRecipe(new ItemStack(ElderChestplate, 1), new Object [] {"E E", "EEE","EEE", 'E', ElderIngot}); GameRegistry.addRecipe(new ItemStack(ElderLeggins, 1), new Object [] {"EEE", "E E", "E E", 'E', ElderIngot}); GameRegistry.addRecipe(new ItemStack(ElderBoots, 1), new Object [] {" ", "E E", "E E", 'E', ElderIngot}); GameRegistry.addShapelessRecipe(new ItemStack(ElderIngot, 9), ElderBlock); //Smelting recepie GameRegistry.addSmelting(ElderOre, new ItemStack(ElderIngot), 2.50F); } }
  2. Hi, I added my custom armour into the game, and everything working, textures, name everything apart from it actually being in the menu! My Armour is only craftable, not even appearing in the creative interface! Help please? Armour Code= package me.irule2222.stuffmod; import net.minecraft.entity.Entity; import net.minecraft.item.ItemArmor; import net.minecraft.item.ItemStack; public class ElderArmour extends ItemArmor { public ElderArmour(ArmorMaterial material, int id, int placement) { super(material, id, placement); setCreativeTab(StuffMain.StuffMod); if (placement == 0) {//if placement is helmet this.setTextureName(StuffMain.modid + ":" + "ElderHelmet"); }else if (placement == 1) {// piece is chestplate this.setTextureName(StuffMain.modid + ":" + "ElderChestplate"); }else if (placement == 2) {// piece is leggins this.setTextureName(StuffMain.modid + ":" + "ElderLeggins"); }else if (placement == 3) {// piece is boots this.setTextureName(StuffMain.modid + ":" + "ElderBoots"); } } public String getArmorTexture(ItemStack stack, Entity entity, int Slot, String type) { if (stack.getItem() == StuffMain.ElderHelmet || stack.getItem() == StuffMain.ElderChestplate || stack.getItem() == StuffMain.ElderBoots) { return StuffMain.modid + ":" + "textures/models/armor/ElderArmor_1.png"; } if (stack.getItem() == StuffMain.ElderLeggins) { return StuffMain.modid + ":" + "textures/models/armor/ElderArmor_2.png"; }else{ return null; } } }
  3. Hi, I've set up my item so that it has a name, texture and everything, but I want it to be dropped when my custom block is broken. I assume its .getItemFromBlock(BlockName); , but that crashes my game whenever I try to load my client? Any ideas?
  4. oh ok tutorials said I do thanks
  5. Hi, I am having a problem with any 1.7.2 forge version. I download the src file, set it up with gradlew setupDecompWorkspace gradlew eclipse once I've done that I open eclipse, I've coded some of my md but want to make a new biome, I understand that In 1.7.2 you have to make a new world type to do that, but I cant edit the files! all the files under forgesrc-1.7.2-10.12.1.1060.jar are al read-only, help please, am I doing something wrong?
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.