Jump to content

[1.7] PreInit, Init and PostInit


RuRo

Recommended Posts

Hi I was trying to mod in 1.7 recently, and after 30 min. of trying to understand why this doesn't work:

 

@EventHandler

public void Init(FMLInitializationEvent event) {

//Add blocks and Items

customBeacon = new CustomBeacon().setBlockName("customBeacon").setCreativeTab(CreativeTabs.tabRedstone);

//Block and Item game registry

GameRegistry.registerBlock(customBeacon, beamcraft.MODID + "_" + CustomBeacon.class.getSimpleName());

}

 

 

I found that copying it into PreInit will fix it.

 

So the question is: Is there

a) A way to know what to put where.

b) A convention, on what order to do stuff in.

c) A basic patter of why some things go in certain places.

 

Ehhh, as far as I remember there used ti be no hardcoded limitaions on Init, PreInit and PostInit.

Link to comment
Share on other sites

Hi, isn't this a bit outdated? I haven't seen people use proxies in a while.

Additionaly, is there a way for me to register my ores only if no ore dictionary matches were found?

How are proxies outdated? It's simply a design decision to use them or not - it has nothing to do with this or that update. The reason many mod authors use proxies is because they greatly facilitate distinguishing between client and server side during mod initialization, which is important for doing things like registering render classes, key handlers, etc., all of which you'd have to do manually otherwise.

Link to comment
Share on other sites

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.