Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Tinarg

Members
  • Posts

    3
  • Joined

  • Last visited

Converted

  • Gender
    Male

Tinarg's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. I think I'll just try starting over with the other tutorial Super found. There's probably a lot of other stuff that's broken too, considering I used an outdated tutorial. Thanks for the help!
  2. I don't think I did this right. What's the syntax for the IForgeRegistryEntry#setRegistryName thingamajig? package com.Tinarg.Test.items; import net.minecraft.item.Item; import net.minecraftforge.fml.common.registry.GameRegistry; import net.minecraftforge.fml.common.registry.IForgeRegistryEntry; public final class ModItems { public static Item TestItem; public static void createItems() { GameRegistry.register(TestItem = new BasicItem("test_item")); IForgeRegistryEntry.setRegistryName(TestItem,"test_item"); } }
  3. I'm new to minecraft modding. I couldn't find any decent tutorials for 1.9, so I've been relying on a 1.8 tutorial (http://bedrockminer.jimdo.com/modding-tutorials) to get started with. Everything went relatively smoothly until I came to implementing a custom item. Eclipse claims GameRegistry.registerItem is deprecated, yet I'm not sure what to use instead. I looked for fixes to this on the internet, but they were all too vague for me to get anything out of them. Can anyone nudge me in the right direction? I'll include the code below. (Sorry for the overabundance of code. I didn't know which scripts were significant to the problem, so I included everything.) Main.java package com.Tinarg.Test; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.common.Mod.EventHandler; import net.minecraftforge.fml.common.Mod.Instance; import net.minecraftforge.fml.common.SidedProxy; import net.minecraftforge.fml.common.event.FMLInitializationEvent; import net.minecraftforge.fml.common.event.FMLPostInitializationEvent; import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; @Mod(modid = Main.MODID, name = Main.MODNAME, version = Main.VERSION) public class Main { public static final String MODID = "test"; public static final String MODNAME = "Test"; public static final String VERSION = "1.9-R1"; @Instance public static Main instance = new Main(); @SidedProxy(clientSide="com.Tinarg.Test.ClientProxy", serverSide="com.Tinarg.Test.ServerProxy") public static CommonProxy proxy; @EventHandler public void preInit(FMLPreInitializationEvent e) { } @EventHandler public void init(FMLInitializationEvent e) { } @EventHandler public void postInit(FMLPostInitializationEvent e) { } } BasicItem.java package com.Tinarg.Test.items; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; public class BasicItem extends Item { public BasicItem(String unlocalizedName) { super(); this.setUnlocalizedName(unlocalizedName); this.setCreativeTab(CreativeTabs.tabMaterials); } } ModItems.java package com.Tinarg.Test.items; import net.minecraft.item.Item; import net.minecraftforge.fml.common.registry.GameRegistry; public final class ModItems { public static Item TestItem; public static void createItems() { GameRegistry.registerItem(TestItem = new BasicItem("test_item"), "test_item"); } } CommonProxy.java package com.Tinarg.Test; import com.Tinarg.Test.items.ModItems; import net.minecraftforge.fml.common.event.FMLInitializationEvent; import net.minecraftforge.fml.common.event.FMLPostInitializationEvent; import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; public class CommonProxy { public void preInit(FMLPreInitializationEvent e) { ModItems.createItems(); } public void init(FMLInitializationEvent e) { } public void postInit(FMLPostInitializationEvent e) { } } Client/ServerProxy.java (Mostly identical) package com.Tinarg.Test; import net.minecraftforge.fml.common.event.FMLInitializationEvent; import net.minecraftforge.fml.common.event.FMLPostInitializationEvent; import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; public class ClientProxy extends CommonProxy { @Override public void preInit(FMLPreInitializationEvent e) { super.preInit(e); } @Override public void init(FMLInitializationEvent e) { super.init(e); } @Override public void postInit(FMLPostInitializationEvent e) { super.postInit(e); } } Thanks in advance, and sorry for being so clueless.
×
×
  • Create New...

Important Information

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