Skip to content

Compiling TotalFreedomMod

Jerom van der Sar edited this page Mar 1, 2016 · 21 revisions

Note: This guide is not up to date for TFM 5.0.
An improved version is coming soon.

Compiling

Compiling TotalFreedomMod from source is the most reliable way to get the latest and most up-to-date version of TFM. Additionally, you can obtain versions of TFM designed for older CraftBukkit/Spigot versions.

Preparations

In order to compile TFM, the following is required to be installed on your computer.

Additionally, we recommend that you install Git SCM as well. During installation, ensure that the "Make Context Menu entries" checkbox is checked.

Setup

  • Firstly, get the TFM version of choice.
    • If you have Git SCM installed (recommended), you can do this by browsing to a folder in which you'd like to store your java projects. Note: Git SCM makes a subfolder for you, so the folder does not have to be empty. Then open Git Bash in this folder. In Git Bash, type git clone https://github.com/TotalFreedom/TotalFreedomMod.git. Git will make and setup your local Git repository for you.
    • If you don't have Git SCM installed, download the appropriate source version of TFM that you'd like to install. Go to TFM's main repository and select the branch that you'd like to compile in the top right corner of the screen. Then click the Download as ZIP button in the lower-right corner of the screen. Finally, extract that folder to a working directory. Download button
  • Download or compile the required dependencies and extract them to a new folder of choice. Make sure you download the right versions of the dependencies, as the release notes of the TFM version indicate.
  • Open NetBeans. If you've never compiled TFM before, your Project Browser might look a bit like this: Project Browser
  • Right click on the top-level "TotalFreedomMod" item and click Resolve Project Problems... Unresolved Libraries
  • Click Resolve...
  • For each unresolved library problem, do the following:
    • Click New Library...
    • Fill in the current exact case-sensitive TFM dependency name (SpigotServer, BukkitTelnet, TF-WorldEdit, and TF-Essentials) New Library
    • Click Add JAR/Folder..., browse and select the appropriate dependency name. Add JAR
  • Click OK, your should now see this: Project problems resolved
  • Click close, your environment is now set up. If you still see errors, you might not have installed the correct dependencies or there's a version mismatch. Recheck your dependencies and try again.

Compilation

  • Compiling is as easy as clicking one of the two Hammer icons. The left icon performs a quick-compile, leaving all pre-compiled class files in tact. The right icon performs a clean-compile, and thus deletes all precompiled class files before recompiling the whole project.
  • Now, TotalFreedomMod.jar should be in dist folder of your project folder. Project compilation

Clone this wiki locally