dimanche 29 mars 2015

Minecraft: Item not registering



So I'm creating a mod in Minecraft. It registers the sword but doesn't appear in the game. What can I do to make it appear in he game? Thanks in advance.



package com.ethan.main;

import net.minecraft.item.Item;
import net.minecraft.item.Item.ToolMaterial;
import net.minecraft.item.ItemSword;
import net.minecraftforge.common.util.EnumHelper;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.registry.GameRegistry;

@Mod(modid = "elemental_swords", version = "1.0 Alpha", name = "Elemental Swords Mod")
public class ElementalSwords {
public static final String modid = "elemental_swords";
public static Item lightningsword;
public static ToolMaterial Element = EnumHelper.addToolMaterial("Element", 9, 1378, 1000, 10, 5);


public void preInit(FMLPreInitializationEvent event){
lightningsword = new LightningSword(Element, "lightningsword");
GameRegistry.registerItem(lightningsword, "Lightning Sword");
}

public void init(FMLInitializationEvent event){

}
}


Here is the Item Class:



package com.ethan.main;

import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraft.item.Item.ToolMaterial;
import net.minecraft.item.ItemSword;

public class LightningSword extends ItemSword{
public LightningSword(ToolMaterial material, String name) {
super(material);

setUnlocalizedName(ElementalSwords.modid + "_" +name);
setTextureName(ElementalSwords.modid + ":" + name);

}



}



Aucun commentaire:

Enregistrer un commentaire