Posted June 21, 20169 yr If my mod downloads another mod to the mods folder, how can I restart the forge start up process to start the mod? I'm working on something big! As long as there arent alot of big issues... [D
June 21, 20169 yr 1. Any program that downloads code is potentially dangerous to user - especially if that would be Mod that would download another mod from URL that can be quite easily exploited. 2. If you think that method like "Load this mod for me right now" exists - I think you don't understand how mods work, or Java for that matter. 3. Best and safest way is to simply restart game (you could display msg saying to do that). If you don't want that - you will have to dive into ClassLoaders. 3.1. Let's say reloading mod (as in load same mod but with changed stuff) is rather impossible (runtime nightmare). 3.2. Loading totally separate classes is actually possible (you can pretty much use normal Java to do that). 3.3. Refering to 3.2. - you could probably use some of Forge code to do the loading for you, but hell - that is some piece of work. Also - there are things that simply cannot be loaded on runtime, for one you shouldn't really touch registry or replace anything that is alredy loaded. Where to look? In Forge packages (Mod discovery processes and callbacks for init methods) and ClassLoader tutorials. Opinion: Don't do it. 1.7.10 is no longer supported by forge, you are on your own.
June 21, 20169 yr Author 1. Any program that downloads code is potentially dangerous to user - especially if that would be Mod that would download another mod from URL that can be quite easily exploited. 2. If you think that method like "Load this mod for me right now" exists - I think you don't understand how mods work, or Java for that matter. 3. Best and safest way is to simply restart game (you could display msg saying to do that). If you don't want that - you will have to dive into ClassLoaders. 3.1. Let's say reloading mod (as in load same mod but with changed stuff) is rather impossible (runtime nightmare). 3.2. Loading totally separate classes is actually possible (you can pretty much use normal Java to do that). 3.3. Refering to 3.2. - you could probably use some of Forge code to do the loading for you, but hell - that is some piece of work. Also - there are things that simply cannot be loaded on runtime, for one you shouldn't really touch registry or replace anything that is alredy loaded. Where to look? In Forge packages (Mod discovery processes and callbacks for init methods) and ClassLoader tutorials. Opinion: Don't do it. ok then, ill just add a GUI prompt for the user to restart on their own, thanks for the feedback! I'm working on something big! As long as there arent alot of big issues... [D
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.