Posted November 18, 20204 yr 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!
November 19, 20204 yr What is the use-case here? You should take a look at how screenshots are implemented if you plan on doing client side saving.
November 19, 20204 yr Author 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.
November 19, 20204 yr 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.
November 19, 20204 yr Author 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.
November 19, 20204 yr 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.
November 19, 20204 yr Author 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.