Jump to content

Two Questions: CommonProxy Interface or Class? and Unlocalized and Registry Names


admiralmattbar

Recommended Posts

1. The Forge documentation suggests making the CommonProxy an interface implemented by Client and Server but I see a lot of mods made by great modders who make the common proxy a class that has it's own code that is then extended by Client and Server. Is there a good reason to do this? Why would someone not just put that code in their main class?

 

2. In 1.11 registry names no longer have the capital letter naming convention. Is there any reason not to just give them the same name and create a method that generates registry names for items that gets the unlocalized name? This seems like it would make things much easier but then why did they do it the other way for so long if it's a good idea?

 

Thanks for any replies. 

Link to comment
Share on other sites

11 hours ago, admiralmattbar said:

1. The Forge documentation suggests making the CommonProxy an interface implemented by Client and Server but I see a lot of mods made by great modders who make the common proxy a class that has it's own code that is then extended by Client and Server. Is there a good reason to do this? Why would someone not just put that code in their main class?

I actually utilized the class version structure to create my EasyRegistry implementation before we had the registry events. I'm not saying it was better, but the hierarchical nature of the common periodproxy being a class meant that item registration (GameRegist.register calls) were in a common location and client only aspects were in the client subclass.

 

However, those methods were generic, they contained no references to outside objects (even the static methods only referenced the main mod class in order to get the proxy instance). All of my blocks and items were handled in the main mod class. 

 

Making that work with IStateMapper (and a few other things) was a hassle, but I managed it. 

 

11 hours ago, admiralmattbar said:

2. In 1.11 registry names no longer have the capital letter naming convention. Is there any reason not to just give them the same name and create a method that generates registry names for items that gets the unlocalized name? This seems like it would make things much easier but then why did they do it the other way for so long if it's a good idea?

Unlocalized name might change for subitems. Look at wool for example: each color had a different name, but the registration name is the same for all of them. Using getUnlocalizedName() for the regisrty name makes no sense. Mods should treat their items the same way. 

  • Like 1

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

Thanks for the replies!

 

Quote

Unlocalized name might change for subitems. Look at wool for example: each color had a different name, but the registration name is the same for all of them. Using getUnlocalizedName() for the regisrty name makes no sense. Mods should treat their items the same way.

 

Okay, this is exactly what I was looking for. It makes sense why they do different names.

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.