Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

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

Featured Replies

Posted

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. 

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. 

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.

  • Author

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.

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...

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.