Jump to content

[1.12.2] Sides issue


Recommended Posts

I am trying to create a mod that writes some player data into file.
I want the file to be updated only when logical server is starting up.
As I can see, @SidedProxy affects physical side only, and the file is not created on local server.
I've tried to use this way:

public static CommonProxy _proxy;

public void preInit(FMLPreInitializationEvent event)
if(FMLCommonHandler.instance().getEffectiveSide() == Side.CLIENT) _proxy = new ClientProxy();
else _proxy = new ServerProxy();

//Other handlers

There ServerProxy.preInit() is:

public void init(FMLInitializationEvent e) 
		System.out.println("init server!");

But now I don't know what to do with registering things: as I understand, I don't have to register anything on logical server when it is physically a client. (Because init methods of ServerProxy aren't called at all on the logical server)

So, what should I do?
I would be happy if there is a way of programming my mod, with only logical server-client separation.


Link to comment
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.
Note: Your post will require moderator approval before it will be visible.

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.

  • Create New...

Important Information

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