Jump to content

Replace Mod jar


tiffit

Recommended Posts

So my mod has an auto updater that downloads a new jar file from the Internet and replaces the current one. I am wondering if it updates in game, if it will mess with the game or the effects only take place after restart.

 

By mess with the game, I mean start using the new jar file

Link to comment
Share on other sites

Read about Java ClassLoader.

 

Answer is a simple NO (it won't).

 

Once classes are loaded nothing from outside changes them, only thing that can "mess" with anything is when you would reference .jar file directly and expect it to have something that it doesn't.

As to assets - they will probably get reloaded (from new .jar) when you'd reload resources, but I am not sure.

 

As to auto-reloading - it would be possible to reload whole .jar in runtime, but sadly MC/Forge are not designed to help you, so you probably can't.

1.7.10 is no longer supported by forge, you are on your own.

Link to comment
Share on other sites

Read about Java ClassLoader.

 

Answer is a simple NO (it won't).

 

Once classes are loaded nothing from outside changes them, only thing that can "mess" with anything is when you would reference .jar file directly and expect it to have something that it doesn't.

As to assets - they will probably get reloaded (from new .jar) when you'd reload resources, but I am not sure.

 

As to auto-reloading - it would be possible to reload whole .jar in runtime, but sadly MC/Forge are not designed to help you, so you probably can't.

Ok, that's what I thought, good.

 

 

So my mod has an auto updater that downloads a new jar file from the Internet
NEVER do that -.-

 

It's not like automatic. It asks the player if they would like to update and if they say yes, then it replaces the jar file

 

 

Link to comment
Share on other sites

meh. It seems that you don't like anything. :)
No I don't like anything that causes the end users frustration, mod pack creators to yell at me. Leaves open untold security holes as standard practice and is just plane annoying.

Do not download executable code and run it. Simple as that.

If users wanna take the risk of running random things then they should know what they are doing.

On top of that, what if you accidentally break something in an 'update' the headake would be enormous if it just instantly shipped to everyone.

 

This is one of those cases that you just have to defer to my 20+ years of experience on the subject. DO NOT DO IT.

I do Forge for free, however the servers to run it arn't free, so anything is appreciated.
Consider supporting the team on Patreon

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.

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.