Skip to content

MCTowns Programmer's Guide

hockeymikey edited this page Jul 14, 2015 · 7 revisions

Overview

This is the launchpad for anyone who wants to either develop for MCTowns, or compile it from source. Here, we will explain how to clone the MCTowns repo, set up your build path, and compile the project for the first time.

Licensing

MCTowns is distributed solely under the GNU General Public License v3. The most important thing to know about this is that it means if you alter MCTowns code or use MCTowns as a dependency, if you distribute your code it MUST be licensed under the GPLv3. To reiterate, if your code is in MCTowns or uses MCTowns, your entire project must be licensed under the GPLv3. MCTowns is free software- keep it that way by using the GPL!

Installing Required Software

MCTowns will require you have the Java SE 7 JDK, git, and maven installed.

Linux (apt):

  • sudo apt-get install openjdk-7-jdk git maven

Linux (yum):

  • sudo yum install java-1.7.0-openjdk-devel git
  • (Note: You'll need to install maven on your own, as it's not in the default repos for CentOS, which is the only yum/rpm system I have access to)

Linux (pacman):

  • pacman -S jdk7-openjdk git maven

Windows:

  • JDK (click JDK, accept the license agreement, then download the correct file for your OS)
  • git
  • maven

Mac:

  • JDK (click JDK, accept the license agreement, then download the correct file for your OS)
  • git
  • maven

Cloning the Repository

  1. If you want to first fork the MCTowns repo here on Github, do that now. Otherwise, go to this page.
  2. Copy this url: [email protected]:jmhertlein/MCTowns.git
  3. Open your console, and type git clone [email protected]:jmhertlein/MCTowns.git. Press enter.
  4. Git will clone the repo for you, and will create an MCTowns folder in your home directory.

Build the Project

If you still have your terminal open from last time, type cd MCTowns to change your directory to the MCTowns directory.

[Developers Only] You probably want to start hacking on the project. Type git checkout dev to switch to the development branch.

Now, type mvn package. Press enter.

Maven will download all dependencies and compile MCTowns. The JAR will be in the target directory.

Contributing

You're now set to start programming. If you're looking for things to work on, PM Everdras on dev.bukkit.org and let him know you're interested in contributing, and he can probably show you a list of things that need work done on them.

MCTowns as a Dependency (Maven)

MCTowns is built with Maven, and also has a repository set up to store artifacts. To use them via maven, edit your pom.xml and merge in these lines:

<repositories>
    ...
    <repository>
        <id>jmh-repo</id>
        <url>http://maven.jmhertlein.net/~joshua/maven/</url>
    </repository>
    ...
</repositories>

and

<dependencies>
    ...
    <dependency>
        <groupId>net.jmhertlein</groupId>
        <artifactId>MCTowns</artifactId>
        <version>2.3.0-LTS</version>
        <scope>provided</scope>
    </dependency>
    ...
</depedencies>

Run a priming build to download the artifacts and you're good to go.

API Documentation

Javadocs can be found here.

Clone this wiki locally