Code should follow the overall project's code style.
We follow Oracle's Standard Programming Practices
with the exception of 10.5.1 Parentheses
. As long as your operator expressions are
clear enough, you should be fine.
To maintain code clarity, use IntelliJ IDEA's 'Reformat Code' function before finishing your work.
Not required for submitting PRs to BreweryX. IntelliJ IDEs should recognize
the copyright included in the .idea
folder automatically.
Before contributing features to BreweryX, ask yourself "Should this be an addon instead?". BreweryX has a mostly-extensive addon API which allows you to create plugin-like addons for BreweryX. Let's take a look at some examples that should be an addon vs what should be a contribution to BreweryX:
- A contribution that adds support for another plugin's custom items <-- ✅ Great as a Contribution
- A contribution which adds GUIs to interface with cauldrons <-- ❌ Changing the core gameplay of Brewery should not be a contribution, write this as an addon instead
- A contribution which patches bugs, exploits, or improves performance of BreweryX <-- ✅ Great as a Contribution
- A contribution which adds growable plants which can be used in recipes <-- ❌ Bloating BreweryX with somewhat-niche features should not be a contribution, write this as an addon instead
Want to get started on building a BreweryX addon? See our wiki page on Creating an Addon.
Local libraries should not be used. Libraries should be declared in build.gradle.kts
with their
repository and Gradle KTS (Short) annotation. If you must use a local jar library for a contribution
explain clearly why you are using a local library and if there are any other options rather than using
a local library.
Translations for BreweryX are always welcome!
Translation contributions should include a config-langs
and languages
addition.
One being a translation for the all configuration files of BreweryX and the other being a translation for
messages sent by the plugin (lang).
Translation files should be named in short language code, e.g. en.yml
for English and zh.yml
for Chinese.
Some people contributing translations may not be familiar with the forking and PR'ing aspect of Git. See below for instructions on how to fork, clone, and submit a PR.
Wiki contributions should have purpose and serve as informative pages to those learning how to navigate BreweryX. When submitting a Wiki PR, make sure the information included is accurate, up-to-date, and concise.
Start by forking the BreweryX repository to your GitHub profile.
If contributing to a repository other than master
(usually for code contributions), uncheck ☑️ Copy the master
branch only.
Once created, navigate to the brightly colored </> Code button just above the file list on the repository. If you know what you're doing, just clone it using whatever method you'd like. If you're new to this, you can fork the repository using GitHub Desktop and edit the files in the Code Editor of your choice.
If you're making Translation or Wiki contributions, VS Code should be fine. If you're making programming contributions, IntelliJ IDEA Community Edition is recommended if you don't already have an IDE/Code Editor of preference.
Install Git if you don't have it already.
- Clone the repository.
git remote add origin https://github.com/BreweryTeam/BreweryX.git
git pull origin master
(or another branch)
-
Make your changes.
-
Push back to your forked Repository of BreweryX
git add --all
git commit -m "I added change XYZ~!"
git push origin master
(or another branch)
On the </> Code button, click the Codespaces
tab.
Learn how to use Codespaces: https://docs.github.com/en/codespaces
I don't recommend editing files without the proper tools like Git or Codespaces at your disposal. If you choose to contribute manually, feel free to, but there won't be a tutorial for this.
GitHub should for the most part, prompt you to open a Pull Request as soon as you push changes to your forked repository. Just navigate to the home page for your repository and follow GitHub's prompts from there.