Jump to content

Recommended Posts

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 ?

Posted

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/

Posted

Forge's documentation explains sides in more detail here.

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.

Posted
  On 10/11/2016 at 12:22 PM, Spooky4672 said:

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.

Posted
  On 10/11/2016 at 7:14 PM, diesieben07 said:

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.

Posted

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.

Posted

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...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.