Jump to content

Recommended Posts

Posted

In your registerRender(Item item) method, it should only contain one line of code registering the item parameter not specific items you made. What do you think you have the item parameter for? This is really basic Java man.

Development of Plugins [2012 - 2014] Development of Mods [2012 - Current]

Posted

Last time I made a minecraft mod was in 1.4.4 around 2 years ago..and in ModLoader.

I knew basics of Java no more. I came here to learn.

 

How can i fix the parameter to support more.

Posted

What your doing is a very basic way of registering and rendering items. Personally, I store items in a list and iterate through them using Java 8's new lambda expressions (I.e forEach) to register and render. Point is, there are many ways to register / render items, just a tip. The registerRender(Item item) just saves time by shortening code, while the registerRender() method contains all the lines of code that call registerRender(Item item) with the item you want to render as the parameter. Hope that was a better explanation than my last post.

Development of Plugins [2012 - 2014] Development of Mods [2012 - Current]

Posted

I think i understood its like sort of reference,instead of writing the whole thing you could just reference it.

 

Problem i dont know what the hell to write i understood the problem and that are many ways to fix it,can you give me a simple one.

Posted

width=500 height=500http://new4.fjcdn.com/comments/Whyyy+_645558cc3b3180c92ab02120fa0eddc8.jpg[/img]

@Mod(modid = Reference.MODID, name = Reference.NAME, version = Reference.VERSION)
public class HarshNature
{
@SidedProxy(clientSide = Reference.CLIENT_PROXY_CLASS, serverSide = Reference.SERVER_PROXY_CLASS)
public static CommonProxy proxy;

@EventHandler
public void preInit(FMLPreInitializationEvent event)
{
	HarshNatureBlocks.init();
	HarshNatureBlocks.register();
	HarshNatureItems.init();
	HarshNatureItems.register();
}

@EventHandler
public void init(FMLInitializationEvent event)
{
	proxy.registerRenders();
}

@EventHandler
public void postInit(FMLPostInitializationEvent event) {}
}

public class Reference
{
public static final String MODID = "hnmod";
public static final String NAME = "Harsh Nature";
public static final String VERSION = "Harsh Nature - Alpha 0.1";
public static final String CLIENT_PROXY_CLASS = "com.drunksmanknife.harshnature.proxy.ClientProxy";
public static final String SERVER_PROXY_CLASS = "com.drunksmanknife.harshnature.proxy.CommonProxy";
}

public class ClientProxy extends CommonProxy
{
@Override
public void registerRenders()
{
	HarshNatureBlocks.registerRenders();
	HarshNatureItems.registerRenders();
}
}

public class HarshNatureItems
{
public static Item Small_Flint;
public static Item Twigs;

public static void init()
{
	Small_Flint = new Item().setUnlocalizedName("Small_Flint");
	Twigs = new Item().setUnlocalizedName("Twigs");
}

public static void register()
{
	GameRegistry.registerItem(Small_Flint, Small_Flint.getUnlocalizedName().substring(5));
	GameRegistry.registerItem(Twigs, Twigs.getUnlocalizedName().substring(5));
}

public static void registerRenders()
{
	registerRender(Small_Flint);
	registerRender(Twigs);
}

public static void registerRender(Item item)
{
	Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(item, 0, new ModelResourceLocation(Reference.MODID + ":" + item.getUnlocalizedName().substring(5), "inventory"));
}
}

1.7.10 is no longer supported by forge, you are on your own.

Posted

Dude you are acting like im some sort of a retard.

I have the basic of the basic,I already understood the problem,my own problem is that even if i figure out a problem i just dont know what the fuck to write.

 

There is so many that i dont know what to do.

You guys knowing better then me doesn't mean you need to be a show off,if you think i only did this to solve my own problem then no.

When i tried looking for a solution for this problem i searched the whole internet and found only one solution about the subject and it wasn't good.

I am doing this also for guys like me who can't find an answer then here is one

 

Thank you for helping me and next time be more sensitive

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

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