7 Replies - 3971 Views - Last Post: 10 October 2011 - 02:29 PM Rate Topic: -----

#1 Crockeo  Icon User is offline

  • D.I.C Head

Reputation: 44
  • View blog
  • Posts: 247
  • Joined: 21-June 11

Extracting from .zip files and adding to .jar files

Posted 09 October 2011 - 08:18 AM

Hello DIC, recently I came up with a neat little idea (which has probably been made already), a mod injector for minecraft! Although the back story doesn't really mean much.

I ran into a problem (which I couldn't find help for on the Oracle help site), though. While I have the GUI right as I want it, I'm unable to figure out how one would extract .zip files, and in turn, add them to a .jar file.

Might anyone have any ideas on this?

Could I somehow treat them as folders and just copy the individual files?

Thank you!
Crockeo

Is This A Good Question/Topic? 0
  • +

Replies To: Extracting from .zip files and adding to .jar files

#2 AVReidy  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 65
  • View blog
  • Posts: 431
  • Joined: 17-February 11

Re: Extracting from .zip files and adding to .jar files

Posted 09 October 2011 - 08:39 AM

Java might be fine for the GUI, but I think you might need to launch a batch file or some sort of script to extract files from a .zip folder.

Once you figure out how to extract your files (classes?), you can probably make a batch file to make a .jar file with your extracted classes.

I can't wait to get my hands on Minecraft's source code, by the way. Hopefully Notch adds modding support soon!

This post has been edited by AVReidy: 09 October 2011 - 08:42 AM

Was This Post Helpful? 0
  • +
  • -

#3 Crockeo  Icon User is offline

  • D.I.C Head

Reputation: 44
  • View blog
  • Posts: 247
  • Joined: 21-June 11

Re: Extracting from .zip files and adding to .jar files

Posted 09 October 2011 - 08:55 AM

Do you think I could find some cross-platform API for Java/C++/Python to do that? Because I'd like to make this able to run on all platforms Java can, making it applicable to everyone who can run Minecraft.

Also, official modding support would be a dream come true :D

Thanks again, Crockeo.
Was This Post Helpful? 0
  • +
  • -

#4 g00se  Icon User is online

  • D.I.C Lover
  • member icon

Reputation: 2652
  • View blog
  • Posts: 11,191
  • Joined: 20-September 08

Re: Extracting from .zip files and adding to .jar files

Posted 09 October 2011 - 04:32 PM

Quote

I'm unable to figure out how one would extract .zip files, and in turn, add them to a .jar file.


When you say 'add', do you mean as in 'add to an existing jar' or as in 'create a jar with them'?
Was This Post Helpful? 0
  • +
  • -

#5 macosxnerd101  Icon User is online

  • Self-Trained Economist
  • member icon




Reputation: 10390
  • View blog
  • Posts: 38,447
  • Joined: 27-December 08

Re: Extracting from .zip files and adding to .jar files

Posted 09 October 2011 - 04:38 PM

I think Minecraft already supports modding. I'm not a gamer, so I'm not really familiar with the platform. However, the Minecraft forums have tutorials you may find helpful.
Was This Post Helpful? 0
  • +
  • -

#6 Crockeo  Icon User is offline

  • D.I.C Head

Reputation: 44
  • View blog
  • Posts: 247
  • Joined: 21-June 11

Re: Extracting from .zip files and adding to .jar files

Posted 09 October 2011 - 07:59 PM

@g00se I mean add, not create a new archive

@macosxnerd101 While you CAN mod Minecraft, it's not official mod support. You have to get your hands dirty with getting the source code from the original Minecraft .classes then modify them and put them back into the minecraft.jar file.

What I'm trying to do is automate the user's end, by giving them a tool which will install the mods for them.
Was This Post Helpful? 0
  • +
  • -

#7 macosxnerd101  Icon User is online

  • Self-Trained Economist
  • member icon




Reputation: 10390
  • View blog
  • Posts: 38,447
  • Joined: 27-December 08

Re: Extracting from .zip files and adding to .jar files

Posted 09 October 2011 - 08:05 PM

pbl has a tutorial on ZIP File I/O. There is a java.util.jar package that has tools to allow you to manipulate JAR files.
Was This Post Helpful? 1
  • +
  • -

#8 Crockeo  Icon User is offline

  • D.I.C Head

Reputation: 44
  • View blog
  • Posts: 247
  • Joined: 21-June 11

Re: Extracting from .zip files and adding to .jar files

Posted 10 October 2011 - 02:29 PM

Thank you for your reply macosxnerd, and thank goodness for pbl!
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1