Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

[SOLVED] [1.10.2] World.isRemote bug ?


Recommended Posts

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 ?

Link to post
Share on other sites

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/

Link to post
Share on other sites

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/

Link to post
Share on other sites

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.

Link to post
Share on other sites

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.

Link to post
Share on other sites

There is no way because this whole system is designed to make singleplayer and server connections behave the same.

You should not ignore the packet on the client. Have a separate config set for the client, which is set by the packet from the server, always.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

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



×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.