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.

Featured Replies

Posted

I'm new to modding and I'm starting with 1.7.10 because I bought Wuppy's book (http://www.amazon.com/Teach-Yourself-Development-Minecraft-Hours/dp/0672337193).

 

Anyways, in the section that talks about creating multiple items using one ID by using metadata, he ends up using the IIcon object which uses @SideOnly(Side.CLIENT).

 

I understand the code and how it works, however, i'm a little lost in the understanding of how this works if I were to run this mod on a dedicated server. Can I run it on a dedicated server? Will the server crash?

 

According to diesieben07 and what he wrote here, it WILL crash.

 

How would I get this to run on a dedicated server then?

 

Any help in understanding this would be greatly appreciated.

 

Thanks

If you're using @SideOnly for any methods fields dealing with IIcon or anything related to textures/rendering then @SideOnly is good. Any of this sort of method will never get called on the server, so using @SideOnly will not cause any problems.

Don't make mods if you don't know Java.

Check out my website: http://shadowfacts.net

Developer of many mods

  • Author

Why won't it get called on the server? I guess my problem is that I don't have ANY experience with client/server programming. Shouldn't everything that gets called on the client, also be called on the server?

 

Here's one method that he uses in the book:

    public void registerIcons(IIconRegister par1IconRegister)
    {
        icons = new IIcon[this.keyNames.length];

        for (int i = 0; i < this.keyNames.length; i++)
        {
            icons[i] = par1IconRegister.registerIcon(SamsMod.MODID + ":" + "key" + " " + keyNames[i]);
        }

    }

 

Don't the icons also need to be "registered" on the server too? How else does the server know what texture/icon goes to what item?

The vanilla Item class already has SideOnly (client) on it.  Redeclaring it isn't going to fuck up anything, and neither will leaving it off.  Nothing in vanilla code calls getIcon when running a dedicated server.  There is NO rendering code on the server, so all rendering related calls are client-side-only and marked as such.

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.

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.