Contributing to Towny
Code contributions are welcome and are made via GitHub's Pull Request.
You must fork the Towny repository (this) and then open it via your IDE.
You can ask for any information/help on your idea/contribution in the Towny IRC.
Please make sure to read our License. If you do not agree with the terms and conditions of our license, please do not contribute any code.
Pull & Code Requirements
- Keep your commit message(s) self-explanitory, description should be a brief explanation and include an issue reference (if applicable.).
- Pull Requests should be simple and straight-forward. One pull request for one feature. Changed Files should only show a difference where code has been removed or added, no re-formatting of entire files.
- Test everything you've touched before pull-requesting. (Exception being language files, we don't expect you to check all lang strings.)
General Code Requirements
With the inclusion of the Maven build system, Towny also makes use of a EditorConfig file. IDEs that support it should automatically follow parts of this section.
- You must use Tabs (Size 4 Spaces).
- Keep your environment in Java 8,
- Avoid using Wildcard imports (It's not preferred, but it's allowed.)
- Don't run IDE Formatters over entire class files, unless it's a new class-file you're implementing.
- This is done to avoid us changing the lines everytime, each IDE is different so we don't have a constant here and there.
- This also keeps file compares on github simple.
- Do not use NMS (Net Minecraft Server), Spigot or Craftbukkit code. Towny uses the Bukkit API only.
- Reflection should be a last resort.
- No Packet-Handling (Netty or ProtcolLib)
For the sanity of the rest of us, please adhere to the following guidelines when attempting to include a dependency or 3rd-party library.
- Libraries need to be approved by the current maintainer before being merged. Preferably, ask before commiting.
- Prevent Class Not Found errors
- Do not reference a plugin in a loaded class, unless that plugin is enabled.
- Do not embed your own plugins within Towny
- Dependencies should be within the 'Provided' scope.
- They will also need peer-review.
- No "Black Box" or Obufscated dependencies.
- All dependencies should have their source open and auditable.
Updating Language Files
The language files are stored in the resources section of the project. (
To update / change an existing language file, fork this repo and then edit the "language".yml in your fork.
Pull-Request your updated version. Please try to keep the title simple and include the version number:
e.g "German Translation v0.42"
If you are creating a new language file, feel-free to use either the english translation e.g "norwegian.yml" or the global placeholder e.g "es-mx"
If you are editing a language which contains the '(apostrophe) character such as French, please make sure you run it all through a YAML Parser,
You have to double up the '' when you want one ' to appear. It may help to do this anyways, as other characters may also require an escape sequence.