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

Hi,

 

world.isRemote should be set to false in a single player game, right ? Because I'm having an issue here :

 

@SubscribeEvent
public void onWorldLoad(WorldEvent.Load event) {
World world = event.getWorld();

if (world.isRemote) {
	// Executed even in single player
}
}

 

Is it normal ?

Client side != Singleplayer!

 

In singleplayer there is still a server running, only accessible for you unless you open to LAN.

World#isRemote

is true on the

client

side (rendering side), and

false

on the server side (logical side).

Don't PM me with questions. They will be ignored! Make a thread on the appropriate board for support.

 

1.12 -> 1.13 primer by williewillus.

 

1.7.10 and older versions of Minecraft are no longer supported due to it's age! Update to the latest version for support.

 

http://www.howoldisminecraft1710.today/

Then how can I test if the world is not local.

 

What exactly do you mean by that?

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

  • Author

I think I found what I want :

 

Minecraft.getMinecraft().isSingleplayer()

 

With that I can now if this is a single player game.

You can only use that on the client side, as the

Minecraft

class is client-side only.

Don't PM me with questions. They will be ignored! Make a thread on the appropriate board for support.

 

1.12 -> 1.13 primer by williewillus.

 

1.7.10 and older versions of Minecraft are no longer supported due to it's age! Update to the latest version for support.

 

http://www.howoldisminecraft1710.today/

  • Author

Yeah, but that's the point. I wanna know, on the client, if this is a single or multiplayer game.

  • Author

Why? This sounds like a terrible idea to me.

 

Without context obviously ...

I synchronize settings between dedicated server and clients, hence the 'not singleplayer' test.

  • Author

This is different.

Some blocks can be deactivated from the config file. If they are, so are the associated recipes. If a dedicated server deactivate blocks, the connected client should also deactivate them, because if not, the recipes will still show, but the result cannot be obtain. This is ugly.

There might be other issues I'm not thinking about, but with this, the client is always configured the same way as a dedicated server, except for client only settings but there is only one for now.

  • Author

It's tricky simply because there is no clean way to intercept that the integrated server has been opened to LAN. I searched for a few minutes and saw nothing: The IntegratedServer#shareToLAN method is called from the button or the command, but I didn't see any way to "register a listener" or something like that.

Like you said, it's simpler to always send it. The client can just ignore it.

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.