Skip to content

Building MCModeler

Caffeinix edited this page Jun 26, 2012 · 2 revisions

To build MCModeler, you will need the following things:

  • A C++ compiler. The Qt SDK on Windows comes with a mingw installation including g++. On the Mac, make sure Xcode and its command-line tools are installed.
  • Git. This is installed with Xcode on the Mac. On Windows, look on the official Git site.
  • The Qt SDK.

That's it. All of MCModeler's other dependencies are bundled with the source.

If you just want to build MCModeler to try it out, you can download the source as a tarball or zip file from the Downloads page. If you're looking to contribute code back, however, or if you want updates, you'll want to clone the repository with Git instead. Doing this is fairly straightforward, and there are lots of tools that will help you if you have trouble figuring it out. Git is a useful skill for a developer to learn anyway, so I'll leave it at that.

Once you have cloned the repository, you have two options:

  1. Launch Qt Creator from the Qt SDK and open src/MCModeler.pro as a project. This is the recommended approach, and is likely to cause you less grief than trying to build your toolchain manually.
  2. run the qmake tool from the Qt SDK on src/MCModeler.pro. This will generate some form of Makefile or other buildable thing depending on your OS and environment, which you can then build using your platform's native toolchain, provided you have everything set up correctly. I only recommend this if you are seriously allergic to IDEs or GUIs and/or enjoy pain.

Now it's nearly time to build MCModeler, but first you should build its dependencies. All of MCModeler's dependencies live in the third_party/qjson directory. To build them, do one of the following:

  1. If you're using Qt Creator: open third_party/qjson/src/src.pro and third_party/quazip/quazip.pro as projects, then click on the Projects button in the sidebar, click the "MCModeler" tab at the top, click on "Dependencies" just below and to the right of that, and click the checkbox next to both of the projects listed there.
  2. If you're using qmake directly: change to the directory containing each dependency's project file and run qmake there, then build the resulting Makefile or project file.

Once you have the dependencies built, you can build MCModeler itself.

  1. If you're using Qt Creator: Just hit Control-B or Command-B to build.
  2. Otherwise, build MCModeler's Makefile or project yourself.

On the Mac, you're done at this point, and should be able to run MCModeler. On Windows, there's one more step: you need to copy three files, third_party/qjson/lib/qjson0.dll, third_party/quazip/lib/quazip.dll, and blocks.json, where MCModeler can see them. qjson0.dll and quazip.dll need to go directly next to MCModeler.exe, the location of which depends upon your setup. If you used Qt Creator, it's probably in a directory whose name starts with "MCModeler-build". It may also be in a "debug" or "release" directory inside that. blocks.json goes in the same place, except it may need to go outside of the "debug" or "release" directory if there is one. Some experimentation may be necessary; if you get it wrong, MCModeler will tell you. If you're not using Qt Creator, just put both files right next to MCModeler.exe and run it from Windows Explorer.

At this point, MCModeler should run when launched. If it doesn't, email me and we'll figure out what went wrong. Also note that MCModeler needs to be able to find a Minecraft installation on your computer in order to load textures for blocks; if it can't find one, there will be problems, so make sure you have Minecraft installed in the usual spot (%APPDATA%/Roaming/.minecraft or similar on Windows, ~/Library/Application Support/minecraft on the Mac).

Clone this wiki locally