Jump to content

How can I know if my mod is instaled on a server or just clientside


Recommended Posts

Posted

Hi, I want to know if my mod is installed in the server or just being used clientside only, this is because I want to save data on a Json if the mod is clientside only.

 

I've tried with the world Load/Unload events but on a singleplayer world those trigger multiple times giving both (True/False) results.

 

Thanks!

Posted

I know how to save the data, what I want to know if the mod is installed on the server or not, if is in the server I save the data on the player, if the mods is being use clientside only, I save the data on a json.

Posted
3 hours ago, Tupaç said:

I know how to save the data, what I want to know if the mod is installed on the server or not, if is in the server I save the data on the player, if the mods is being use clientside only, I save the data on a json.

But why not save the data on the player regardless? A singleplayer world still has as associated integrated server that others can join.

Posted
1 minute ago, ChampionAsh5357 said:

But why not save the data on the player regardless? A singleplayer world still has as associated integrated server that others can join.

Sorry I may be explaining this incorrectly, the idea is that any player with the mod can join a server that doesn't have the mod, so I can't ask the server to save my data because of this, witch I solve saving the data on a json in the profile folder.

Posted
5 minutes ago, Tupaç said:

Sorry I may be explaining this incorrectly, the idea is that any player with the mod can join a server that doesn't have the mod, so I can't ask the server to save my data because of this, witch I solve saving the data on a json in the profile folder.

Well then, if you're saving data via the logical server, you can check FmlEnvironment#dist to see if you're on the physical client or physical server.

Posted
11 minutes ago, ChampionAsh5357 said:

Well then, if you're saving data via the logical server, you can check FmlEnvironment#dist to see if you're on the physical client or physical server.

Hmm, unfortunately this doesn't seems to work, it considers singleplayer as client and that doesn't work with my purpose.

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.