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

At first I was thinking that's maybe beacuse Server is running in the background, or maybe it's just bug, but now it started to bother me.

WTF.jpg

I am using this code:

@Override
public void onBlockDestroyedByPlayer(World par1World, int x, int y, int z, int m)
{
	Random generator = new Random(); 
	int X = generator.nextInt(10000) + 1;

	System.out.println(X);
}

It gives me 2x random numbers every time I destroy block - WHY?! And will it cause problems on MP?

Note that no matter if I use Random or not, all the System.out will run twice.

ย 

1.7.10 is no longer supported by forge, you are on your own.

Yes it's because of the server and client threads. If you only want it called on one side use an if statement, with world.isRemote which returns true on the client and false on the server. This shouldn't cause a problem, normally you want to do things on both, but sometimes you will only want t do it on the server, and very very rarely you may want to do something only on the client (although i'm not sure why)

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.