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

Hello everyone,

I tought i make this simple info because i saw a lot of people using @SideOnly to make their code only run on one side.

Thats a bad idea!

@SideOnly is for making a code only VISIBLE for one side. Feel the difference?

Its good for registration purposes, but you have your Common and ClientProxy, right?

 

You might ask now, than what can we use???

If in your code you have a World as argument or instance you can use: if(world.isRemote)

-world.isRemote = CLIENT

-!world.isRemote = SERVER

Its that simple!

 

Or if you cannot get world for some reason use SIDE checking:

Side side = FMLCommonHandler.instance().getEffectiveSide();

if(side == Side.CLIENT) {

System.out.println("CLIENT");

}else{

System.out.println("SERVER");

}

 

Hope you now not gonna mess up your code and be suprised why is it not working!

  • Author

Im just trying to write that for modders who don't understand it.

It not what i don't understand its for others :)

You probably getting sick by seeing how everyone use @SideOnly even if they dont know what it is for.

Well they can know it now.

 

 

i must admit i have been wondering why use proxys when you can tell what side code to be with "side only" but then i have never fully understood the proxy classes, most guides will tell you how to create them but not how to effectively use them, they along with packet handlers remain a bit of a mystery to me.

I have always taken the approach that if my code works then im happy, im sure if many seasoned modders looked at my source code they would hunt me down with pitchforks :), but then im only modding for the fun of getting something working in game not for the masses(will be released as always for those that may want it but im not planning to be the next calclavia/xcompwizard/dan200 etc etc)

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.