Skip to content

If you want to contribute to Forge

luacs1998 edited this page Mar 19, 2014 · 24 revisions

Prerequisites: Eclipse (3.7 or better is probably good), Ant 1.8.2+ (the java build tool)

  1. Fork the MinecraftForge repository
  2. Clone your repository, and make sure you initialize the FML submodule (git clone --recursive [your URL])
  3. Run "gradlew setupForge eclipse". If you're on Windows, do .\fml\python\python_fml.exe setup.py from your Forge root. If you're on Mac or Linux, you probably already have Python installed and can do python setup.py. This also sets up FML
  4. You will have an "eclipse" folder in your Forge root. There will be two projects - "Clean" and "Forge". Make your changes to "Forge"
  • Make sure you run and test your changes
  • Run "gradlew genPatches" (in the Forge root) to generate patch files for Minecraft base classes
  • Submit a pull request. Explain as much as you did

Tips

  • Take your time. Make sure your code does what it's supposed to do and does it well. Your PR probably won't be accepted if it doesn't cover all the uses
  • Indent your code properly, and follow the conventions (take a look at other classes and read the code before editing). Space instead of tabs, open braces on a new line, etc.
  • To update your repo to latest code from the official repository:
    1. If it's the first time, add a remote for the official repo (git remote add upstream [email protected]:MinecraftForge/MinecraftForge.git)
    2. Get the updates (git fetch upstream), and make sure you're on master (git checkout master)
    3. If you don't want to rewrite your history (e.g. others have cloned your repository), do a merge (git merge upstream/master). For keeping pull requests as clean as possible, do a rebase (git rebase upstream/master). Git may reject your push the first time after each rebase and you'll have to do git push -f origin master (or git push origin master --force).
Clone this wiki locally