I believe i have discovered a feature that will make modding much easier and less frustrating for newbies and oldies alike. This is a proof of concept I have uncovered. I know this works in windows not sure if it works in linux or mac though, possibily.
I was thinking about all of this class path stuff then the thought occured to me, why can't we make an external jar for storing mods? I tried it and completed the tast. Then I thought i'd one up myself and I thought what if i can do this by a simple folder structure? -answer YES YOU CAN!!!
when you normally launch minecraft.jar you type something like this:
It accepts all files in bin/* directory on load. This includes any jar files, or 1 correctly done jar/folder.
So then i needed a way to get the engine to load a folder as a jar.
So I tried all kinds of things: minecraft.jar mods.jar minecraft2.jar minecraft_2.jar then I found it, name a folder $mods.jar or even !mods.jar, add files (mods) to it, then load it in the path of launching the jar!
this is so exicting I'll be writing a tutorial in just a sec but i post this news immediatly.
Conclusion: In theory this allows you to have an unpatched or minimally patch minecraft.jar and a folder $mods.jar included in the launch path that will have all of your mods files that will overwrite key minecraft classes. the regular mods folder in .minecraft will STILL WORK as well!
***Note if you decide to load the entire bin directory (my launcher does this by default) into launch it will launch EVERYTHING that is jar in that folder even copies and backups --> like mcpatcher makes which will cause problems crashes eventually or immediatly esp if there are full minecraft.jar duplicates!!!***
You can try those commands,
Or for easier options use my toolkit here:
2) go to minecraft bin directory it usually is in %APPDATA%\.minecraft\bin
3) create a folder or copy from my utility the prepared folder, named: $mods.jar
4) run mcpatcher for hd textures, and/or if you are in a compatible version (1.5_1 then run shaders installer)
5) delete or move any duplicates of minecraft jar (mcpatcher calls them something like minecraft-1.5.01.jar for example
6) don't mess with minecraft.jar anymore!! PERIOD!
7) put mods that you would normally need to install in minecraft.jar into $mods.jar keeping the folder structure same as minecraft.jar internally. (include modloader and audiomod here too for example)
8) run minecraft.jar (maybe via my launcher {offline goes in bin directory, and regular launcher wherever your small minecraft.jar is (if you do that will require editing the ini after you create it just a FYI)} if you hate command line) including in the path either the $mods.jar directory or the entire bin directory! example commands to place in cmd window (windows):
9) rinse and repeat, testing mod file, file order, etc, combinations till you have one you can live with, to your hearts content!
10) PROFIT!!
This means you can have a minecraft jar, patch it , and be done with extracting re-extracting.
***Note this will take some patience as mod compatiability is not certain with all mods***
+ if you run the shader installer, create a directory $mods.jar/shaders in your bin folder and place your wanted shaders, and they will override those inside the minecraft.jar too, WITHOUT HAVING TO EXTRACT IT!!!!!
THIS MEANS NO MORE EXTRACTING MINECRAFT JAR FOR MODS POSSIBLITY!!
UPDATE: Note, you'll prolly want to run at least the hd patcher or shader patcher, otherwise to get mods to work you'll still need to delete the META-INF folder (hd patcher does this for you). Just with the hd patcher (mc patcher) make sure to delete the backup minecraft-*version*.jar if you are loading the entire bin folder (ie using my launcher or doing this on the commandline like this), otherwise minecraft will attempt to load two copies of itself with different files and usually will crash.
UPDATE2: GUIAPI has a minor (bug/glitch) that it will search for two files in the current jar or crash on attempting to launch the menu. These two files are:
font/default.png
gui/gui.png
Simply copy them (including folder structure) to the $mods.jar from minecraft.jar and it fixes this. Otherwise I've noticed no other mod specific compatibility issues yet.
Although with almost all ModLoader compatible mods, you can just put them in the /mods folder. Then you don't have to make and edit new jars or launch Minecraft with extra commands. It's especially easier if you have the Minecraft.exe and don't launch your MC with the command line..
Yeah but what this does is you don't have to manually extract edit, the minecraft.jar ONCE EVEN TECHNICALLY!!! And still supports loading the modloader mods from their directory as well! If you don't like command line try my jar launcher it supports this and has a built in config program. If you need help with that program feel free to ask, or problems, suggestions! :smile.gif:
This is great for newbies or people who don't like to edit the minecraft.jar and keep it safer.
Plus if a mod doesn't work just delete the files you added in the folder and try again. no extract, recompress, or even edit with some third party jar/zip utility ANYMORE!!!
Hmm.. I can understand where you're coming from, people who are complete computer noobs will like this. I guess for me, since I'm a bit more advanced of a computer user, it seems a little silly to need this just for people who don't want to right click and select "Open with.." and then an archiver. I mean really, it's no harder to download winRAR or 7-Zip than it is to download your tookit. And once you have the toolkit, you have to mess with file structure to get it to work properly.
put mods that you would normally need to install in minecraft.jar into $mods.jar keeping the folder structure same as minecraft.jar internally. (include modloader and audiomod here too for example)
How do you know what the folder structure of minecraft internally is, if you never open the jar and look at it.. Maybe it's just me, but this seems like more work..
I don't mean to bash on your idea, I promise. I appreciate the effort you've put forth to simplify others lives. I'm really not trying to insult you or make you think I hate the idea. I'm sure it will help some people. :smile.gif:
Also technically if you are editing a jar file with a zip program it is prone to DATA CORRUPTION AND/OR LOSS. So the BEST method until now was extract and use the Java sdk "JRD" to create a new jar file:
As far as the folder structure, just place files that modders say to put in minecraft.jar into $mods.jar directory instead now. The ones made for modloader that support loading via the .minecraft/mods folder can still be put there usually in the archive as a zip in the folder place in "minecraft directory".
And i'm open to feedback i could make a drag and drop jar version of the launcher if anyone would like me to.
Hmm, I bet you could combine this with my vb app that makes multiple jar files useable and selectable at launch (Which is what my launcher does)
Currently my app allows you to create a "preset list" of jars so that you can choose any one you want and run it, useful for running multiple versions or modded/unmodded jars without touching your bin folder.
If your interested drop me a pm and we can discuss it.
I mean really, it's no harder to download winRAR or 7-Zip than it is to download your tookit. And once you have the toolkit, you have to mess with file structure to get it to work properly.
This should be fixed my launcher now allows you to drag and drop in the window, with instructions (or type if your confident) to set the folder paths in the ini.
I don't mean to bash on your idea, I promise. I appreciate the effort you've put forth to simplify others lives. I'm really not trying to insult you or make you think I hate the idea. I'm sure it will help some people.
No worries i wasn't yelling or being defensive I was just so excited about this, hope i didn't come across that way.
--------
Has anyone tried this besides me, any bugs or glitches, comments, complaints? -Remember this works on every version of minecraft even the popular 1_5_1 and 1_6_5. I want to see if its a fix for the community to simplify, make safer, and expediate modding process for minecraft.
So it will make my (adding mods) life easier by Patching instead of Extracting?
You only need to patch once if you need hd textures (or again if you use the patcher for shaders), or delete the meta-inf.
After that you simply drag any mods (that say put in minecraft.jar contents) to the $mods.jar folder. if you don't like a mod delete it from the folder it doesn't touch the actually minecraft.jar after the one time patching/deletion of the meta-inf.
Mod loader has a similar feature that lets you load mods from the .minecraft/mods directory however this is a higher level override it seems.
The difference here is this feature is built-in but not documented.
Hope its helpful to someone :smile.gif:.
----
ZeuX wow i'll check that out, I still think this was an interesting find though if that turns out easier to do.
Although with almost all ModLoader compatible mods, you can just put them in the /mods folder. Then you don't have to make and edit new jars or launch Minecraft with extra commands. It's especially easier if you have the Minecraft.exe and don't launch your MC with the command line..
Just type that in any word processor, and save as bat.
Clip the icon from the minecraft.exe to the new .bat file.
Run the .bat to play minecraft!
As with version 1.7.3 of minecraft running on 1.7 java jre it seems java can load "any" folder as a jar as long as it is set in the class path. The whole point of the $mods.jar exercise was that it loads folders after it loads jars so it can overwrite existing classes with new ones.
With the new minecraft setup you could simply extract the jar minecraft.jar to a folder minecraft, you should then rename the extension/move/delete the jar and then rename the folder to minecraft.jar and it will read the folder as it would a jar. So we can skip the whole rejaring process altogether then.
For example in a normal installation where the minecraft.jar launcher that you download from the website is in %APPDATA%/.minecraft/Launcher directory:
SetLocal
REM set APPDATA="Your actual minecraft path the directory below .minecraft"
REM EXAMPLE:
set APPDATA=C:\Users\Drathian\Desktop\test\minecraft\
java.exe -cp %APPDATA%.minecraft\Launcher\Minecraft.jar;%APPDATA%.minecraft\bin\* net.minecraft.LauncherFrame
EndLocal
it seems in the classpath option "-cp" or "-classpath" it will load folders or jars paths that are seperated by ";" semi-colons, as far as I can tell the first listed item in classpath is loaded last. On my configuration for example its like this:
SetLocal
set APPDATA=C:\Users\Drathian\Desktop\test\mcp_data\
cd\
cd %APPDATA%
java -cp $mods.jar;test;minecraft.jar;jinput.jar;lwjgl.jar;lwjgl_util.jar -Djava.library.path=natives net.minecraft.client.Minecraft
EndLocal
$mods.jar is loaded after test and after minecraft. Everything after minecraft.jar is there to support it.
Hope this information continues to be useful.
**** ON a side note to batch portable launcher developers always use the SetLocal, and Endlocal if you are setting the %APPDATA% variable. Windows is usually smart enough to reset it but if it doesn't something wicked your way comes!!!***
Although with almost all ModLoader compatible mods, you can just put them in the /mods folder. Then you don't have to make and edit new jars or launch Minecraft with extra commands. It's especially easier if you have the Minecraft.exe and don't launch your MC with the command line..
Actually in addition to this:
I've tested this and technically you can put any class file in /mods and it will load it after modloader, as long as modloader is loaded via the jar classpath (ie the minecraft.jar, or in my version $mods.jar folder)
Same can go for any class files left in .minecraft/bin, it seems java isn't picky where it loads from so make sure to always have only what you want to load in the classpath :smile.gif:. ie: having two minecraft.jars like after you run mcpatcher is bad: (minecraft.jar, minecraft.173.jar WILL CAUSE out of bounds errors)
The Minecraft.exe is simply minecraft.jar launcher with exe compatabily extension via the java specifications BTW.
I believe i have discovered a feature that will make modding much easier and less frustrating for newbies and oldies alike. This is a proof of concept I have uncovered. I know this works in windows not sure if it works in linux or mac though, possibily.
I was thinking about all of this class path stuff then the thought occured to me, why can't we make an external jar for storing mods? I tried it and completed the tast. Then I thought i'd one up myself and I thought what if i can do this by a simple folder structure? -answer YES YOU CAN!!!
when you normally launch minecraft.jar you type something like this:
java.exe -Xmx1024M -Xms32M -cp C:\minecraftpath\.minecraft\launcher\Minecraft.jar net.minecraft.LauncherFrame
well if you add this extra line here:
java.exe -Xmx1024M -Xms32M -cp C:\minecraftpath\.minecraft\launcher\Minecraft.jar;C:\minecraftpath\.minecraft\bin\* net.minecraft.LauncherFrame
It accepts all files in bin/* directory on load. This includes any jar files, or 1 correctly done jar/folder.
So then i needed a way to get the engine to load a folder as a jar.
So I tried all kinds of things: minecraft.jar mods.jar minecraft2.jar minecraft_2.jar then I found it, name a folder $mods.jar or even !mods.jar, add files (mods) to it, then load it in the path of launching the jar!
this is so exicting I'll be writing a tutorial in just a sec but i post this news immediatly.
Conclusion: In theory this allows you to have an unpatched or minimally patch minecraft.jar and a folder $mods.jar included in the launch path that will have all of your mods files that will overwrite key minecraft classes. the regular mods folder in .minecraft will STILL WORK as well!
***Note if you decide to load the entire bin directory (my launcher does this by default) into launch it will launch EVERYTHING that is jar in that folder even copies and backups --> like mcpatcher makes which will cause problems crashes eventually or immediatly esp if there are full minecraft.jar duplicates!!!***
You can try those commands,
Or for easier options use my toolkit here:
http://www.minecraftforum.net/topic/329087-tool-minecraft-jar-launcher/
This means you can have a minecraft jar, patch it , and be done with extracting re-extracting.
***Note this will take some patience as mod compatiability is not certain with all mods***
+ if you run the shader installer, create a directory $mods.jar/shaders in your bin folder and place your wanted shaders, and they will override those inside the minecraft.jar too, WITHOUT HAVING TO EXTRACT IT!!!!!
THIS MEANS NO MORE EXTRACTING MINECRAFT JAR FOR MODS POSSIBLITY!!
UPDATE: Note, you'll prolly want to run at least the hd patcher or shader patcher, otherwise to get mods to work you'll still need to delete the META-INF folder (hd patcher does this for you). Just with the hd patcher (mc patcher) make sure to delete the backup minecraft-*version*.jar if you are loading the entire bin folder (ie using my launcher or doing this on the commandline like this), otherwise minecraft will attempt to load two copies of itself with different files and usually will crash.
UPDATE2: GUIAPI has a minor (bug/glitch) that it will search for two files in the current jar or crash on attempting to launch the menu. These two files are:
Simply copy them (including folder structure) to the $mods.jar from minecraft.jar and it fixes this. Otherwise I've noticed no other mod specific compatibility issues yet.
This is great for newbies or people who don't like to edit the minecraft.jar and keep it safer.
Plus if a mod doesn't work just delete the files you added in the folder and try again. no extract, recompress, or even edit with some third party jar/zip utility ANYMORE!!!
I don't mean to bash on your idea, I promise. I appreciate the effort you've put forth to simplify others lives. I'm really not trying to insult you or make you think I hate the idea. I'm sure it will help some people. :smile.gif:
via
etc...
I heard this from some apple people btw.
As far as the folder structure, just place files that modders say to put in minecraft.jar into $mods.jar directory instead now. The ones made for modloader that support loading via the .minecraft/mods folder can still be put there usually in the archive as a zip in the folder place in "minecraft directory".
And i'm open to feedback i could make a drag and drop jar version of the launcher if anyone would like me to.
Currently my app allows you to create a "preset list" of jars so that you can choose any one you want and run it, useful for running multiple versions or modded/unmodded jars without touching your bin folder.
If your interested drop me a pm and we can discuss it.
This should be fixed my launcher now allows you to drag and drop in the window, with instructions (or type if your confident) to set the folder paths in the ini.
No worries i wasn't yelling or being defensive I was just so excited about this, hope i didn't come across that way.
--------
Has anyone tried this besides me, any bugs or glitches, comments, complaints? -Remember this works on every version of minecraft even the popular 1_5_1 and 1_6_5. I want to see if its a fix for the community to simplify, make safer, and expediate modding process for minecraft.
You only need to patch once if you need hd textures (or again if you use the patcher for shaders), or delete the meta-inf.
After that you simply drag any mods (that say put in minecraft.jar contents) to the $mods.jar folder. if you don't like a mod delete it from the folder it doesn't touch the actually minecraft.jar after the one time patching/deletion of the meta-inf.
Mod loader has a similar feature that lets you load mods from the .minecraft/mods directory however this is a higher level override it seems.
The difference here is this feature is built-in but not documented.
Hope its helpful to someone :smile.gif:.
----
ZeuX wow i'll check that out, I still think this was an interesting find though if that turns out easier to do.
Just type that in any word processor, and save as bat.
Clip the icon from the minecraft.exe to the new .bat file.
Run the .bat to play minecraft!
As with version 1.7.3 of minecraft running on 1.7 java jre it seems java can load "any" folder as a jar as long as it is set in the class path. The whole point of the $mods.jar exercise was that it loads folders after it loads jars so it can overwrite existing classes with new ones.
With the new minecraft setup you could simply extract the jar minecraft.jar to a folder minecraft, you should then rename the extension/move/delete the jar and then rename the folder to minecraft.jar and it will read the folder as it would a jar. So we can skip the whole rejaring process altogether then.
For example in a normal installation where the minecraft.jar launcher that you download from the website is in %APPDATA%/.minecraft/Launcher directory:
Would load any jar in .minecraft\bin\
A simple portable version would look like this:
it seems in the classpath option "-cp" or "-classpath" it will load folders or jars paths that are seperated by ";" semi-colons, as far as I can tell the first listed item in classpath is loaded last. On my configuration for example its like this:
$mods.jar is loaded after test and after minecraft. Everything after minecraft.jar is there to support it.
Hope this information continues to be useful.
**** ON a side note to batch portable launcher developers always use the SetLocal, and Endlocal if you are setting the %APPDATA% variable. Windows is usually smart enough to reset it but if it doesn't something wicked your way comes!!!***
Actually in addition to this:
I've tested this and technically you can put any class file in /mods and it will load it after modloader, as long as modloader is loaded via the jar classpath (ie the minecraft.jar, or in my version $mods.jar folder)
Same can go for any class files left in .minecraft/bin, it seems java isn't picky where it loads from so make sure to always have only what you want to load in the classpath :smile.gif:. ie: having two minecraft.jars like after you run mcpatcher is bad: (minecraft.jar, minecraft.173.jar WILL CAUSE out of bounds errors)
The Minecraft.exe is simply minecraft.jar launcher with exe compatabily extension via the java specifications BTW.