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've been modding for a few months now and I've always build my mod by putting it into the src/minecraft folder and then running recompile.sh and then reobfuscate_srg.sh. And it worked flawlessly on both client and server side.

But the last time I tried it I keep getting errors when I try to run it on a server (client still works perfectly)

The errors vary but they are all NoSuchMethod/NoSuchField (not sure if exact name, but shouldn't matter) exceptions, thrown by fields such as this:

 

@SideOnly(Side.CLIENT)

private Icon[] icon = new Icon[2];

 

And if I comment that one out, then some other client only field throws the same/similar exception (EntityPlayerSP from when one of my events loads up, even though I don't import/use it anywhere in the methods).

I tried using the last 3 versions of forge (930 and beyond) getting the same results.

 

Am I doing something wrong? Can someone point me out on the right direction.

 

Thank you :)

you're accessing client on fields on the dedicated server.

They flat out do not exist on the dedicated server.

Hence why they are CLIENTonly

Quit referencing code that doesn't exist.

I do Forge for free, however the servers to run it arn't free, so anything is appreciated.
Consider supporting the team on Patreon

  • Author

but for example.. the icon variable I showed.

I only use it twice... creating the variable, and then registering it (in that usual method), both with the SideOnly(Side.Client) annotation.

 

If that's wrong, than how am I meant to register block icons for example?

private Icon[] icon = new Icon[2];

The 'icon = new Icon[2];' Is actually code that is compiled into your constructor.

So if you have side only fields, you can't use inline initalizers.

I do Forge for free, however the servers to run it arn't free, so anything is appreciated.
Consider supporting the team on Patreon

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.