JMPQ3 is a small java library for accessing and modifying mpq (MoPaQ) archives. Common file endings are .mpq, .w3m, .w3x.
MoPaQ is Blizzard's old, proprietary archive format for storing gamedata (replaced with CASC).
You can find more info and an excellent graphical editor here http://www.zezula.net/en/mpq/main.html
currently only warcraft 3 maps and mpqs are confirmed supported. Mpqs from other games (WoW, starcraft) might cause problems.
It is recommended to use jitpack with a dependency manager like gradle.
See https://jitpack.io/#inwc3/JMPQ3/
Gradle Example:
dependencies {
compile 'com.github.inwc3:JMPQ3:1.5.5'
}
allprojects {
repositories {
maven { url 'https://jitpack.io' }
}
}
You can still download the jar directly if you prefer https://github.com/inwc3/JMPQ3/releases
Quick API Overview:
Jmpq provides the OpenOptions READ_ONLY
which should be selfexplanatory and FORCE_V0
which forces the mpq to be opened like warcraft3 would open it, ignoring optional data from later specifications for compatability.
// Automatically rebuilds mpq after use if not in readonly mode
try (JMpqEditor e = new JMpqEditor(new File("my.mpq"), MPQOpenOption.FORCE_V0)){
e.hasFile("filename"); //Checks if the file exists
e.extractFile("filename", new File("target location")); //Extracts a specific file out of the mpq to the target location
if (e.isCanWrite()) {
e.deleteFile("filename"); //Deletes a specific file out of the mpq
e.insertFile("filename", new File("file to add"), true); //Inserts a specific into the mpq from the target location
e.extractAllFiles(new File("target folder")); //Extracts all files inside the mpq to the target folder. If a proper listfile exists,
e.getFileNames(); //Get the listfile as java HashSet<String>
}
}
}
- To work around https://bugs.openjdk.java.net/browse/JDK-4724038 jmpq creates tempfiles for every object in the mpq
- Unsupported decompression algorithms: sparse, pkware and bzip2
- Only supported compression is zlib
- JMPQ doesn't build a valid (attributes) file for now. (which seems to be fine for warcraft3)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.