Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 21 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@ An example mod for Minecraft 1.7.10 with Forge focussed on a stable, updatable s
<!-- omit in toc -->
### Table of Contents

* [Example Forge Mod for Minecraft 1.7.10](#example-forge-mod-for-minecraft-1710)
* [Motivation](#motivation)
* [Help! I'm stuck!](#help-im-stuck)
* [Getting started](#getting-started)
* [Features](#features)
* [Files](#files)
* [Forge's Access Transformers](#forges-access-transformers)
* [Mixins](#mixins)
* [Advanced](#advanced)
* [Feedback wanted](#feedback-wanted)
- [Example Forge Mod for Minecraft 1.7.10](#example-forge-mod-for-minecraft-1710)
- [Motivation](#motivation)
- [Help! I'm stuck!](#help-im-stuck)
- [Getting started](#getting-started)
- [Features](#features)
- [Files](#files)
- [Forge's Access Transformers](#forges-access-transformers)
- [Mixins](#mixins)
- [Advanced](#advanced)
- [Feedback wanted](#feedback-wanted)


### Motivation
Expand All @@ -26,7 +26,7 @@ We had our fair share in struggles with build scripts for Minecraft Forge. There

### Help! I'm stuck!

We all have been there! Check out our [FAQ](https://github.com/GTNewHorizons/ExampleMod1.7.10/blob/main/docs/FAQ.md). If that doesn't help, please open an issue.
We all have been there! Check out our [FAQ](docs/FAQ.md). If that doesn't help, please open an issue.

### Getting started

Expand All @@ -37,14 +37,14 @@ Creating mod from scratch:
4. Replace placeholders (edit values in gradle.properties, change example package and class names, etc.)
5. Run `./gradlew setupDecompWorkspace`
6. Run `./gradlew build`
6. Make sure to check out the rest sections of this file.
7. You are good to go!
7. Make sure to check out the rest sections of this file.
8. You are good to go!

We also have described guidelines for existing mod [migration](docs/migration.md) and [porting](docs/porting.md)

### Features

- Updatable: Replace [`build.gradle`](https://github.com/GTNewHorizons/ExampleMod1.7.10/blob/main/build.gradle) with a newer version
- Updatable: Replace [`build.gradle.kts`](build.gradle.kts) with a newer version
- Optional API artifact (.jar)
- Optional version replacement in Java files
- Optional shadowing of dependencies
Expand All @@ -60,13 +60,13 @@ We also have described guidelines for existing mod [migration](docs/migration.md
- Running smoke test for server startup. On any server crash occurring workflow will fail and print the crash log.

### Files
- [`build.gradle`](https://github.com/GTNewHorizons/ExampleMod1.7.10/blob/main/build.gradle): This is the core script of the build process. You should not need to tamper with it, unless you are trying to accomplish something out of the ordinary. __Do not touch this file! You will make a future update near impossible if you do so!__
- [`gradle.properties`](https://github.com/GTNewHorizons/ExampleMod1.7.10/blob/main/gradle.properties): The core configuration file. It includes
- [`dependencies.gradle[.kts]`](https://github.com/GTNewHorizons/ExampleMod1.7.10/blob/main/dependencies.gradle): Add your mod's dependencies in this file. This is separate from the main build script, so you may replace the [`build.gradle`](https://github.com/SinTh0r4s/ExampleMod1.7.10/blob/main/build.gradle) if an update is available.
- [`repositories.gradle[.kts]`](https://github.com/GTNewHorizons/ExampleMod1.7.10/blob/main/repositories.gradle): Add your dependencies' repositories. This is separate from the main build script, so you may replace the [`build.gradle`](https://github.com/SinTh0r4s/ExampleMod1.7.10/blob/main/build.gradle) if an update is available.
- `addon.gradle[.kts]`: Any additional build logic. This is separate from the main build script, so you may replace the [`build.gradle`](https://github.com/SinTh0r4s/ExampleMod1.7.10/blob/main/build.gradle) if an update is available. See [Advanced](#advanced) for more details.
- [`jitpack.yml`](https://github.com/GTNewHorizons/ExampleMod1.7.10/blob/main/jitpack.yml): Ensures that your mod is available as import over [Jitpack](https://jitpack.io).
- [`.github/workflows/gradle.yml`](https://github.com/GTNewHorizons/ExampleMod1.7.10/blob/main/.github/workflows/gradle.yml): A simple CI script that will build your mod any time it is pushed to `master` or `main` and publish the result as release in your repository. This feature is free with GitHub if your repository is public.
- [`build.gradle.kts`](build.gradle.kts): This is the core script of the build process. You should not need to tamper with it, unless you are trying to accomplish something out of the ordinary. __Do not touch this file! You will make a future update near impossible if you do so!__
- [`gradle.properties`](gradle.properties): The core configuration file. It includes
- [`dependencies.gradle[.kts]`](dependencies.gradle): Add your mod's dependencies in this file. This is separate from the main build script, so you may replace the [`build.gradle.kts`](build.gradle.kts) if an update is available.
- [`repositories.gradle[.kts]`](repositories.gradle): Add your dependencies' repositories. This is separate from the main build script, so you may replace the [`build.gradle.kts`](build.gradle.kts) if an update is available.
- `addon.gradle[.kts]`: Any additional build logic. This is separate from the main build script, so you may replace the [`build.gradle.kts`](build.gradle.kts) if an update is available. See [Advanced](#advanced) for more details.
- [`jitpack.yml`](jitpack.yml): Ensures that your mod is available as import over [Jitpack](https://jitpack.io).
- [`.github/workflows/build-and-test.yml`](.github/workflows/build-and-test.yml): A simple CI script that will build your mod any time it is pushed to `master` or `main` and publish the result as release in your repository. This feature is free with GitHub if your repository is public.

### Forge's Access Transformers

Expand Down
6 changes: 3 additions & 3 deletions docs/migration.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ Migration for the typical mod which doesn't use anything special but Minecraft f
For core plugin, Mixins, shadowing, access transformers, ASM or etc. you'll need to do some extra steps.
If they are missing in this document - we will gladly receive your suggestions/contribution.

1. Copy and replace all files from [template](https://github.com/GTNewHorizons/ExampleMod1.7.10/releases/download/master-packages/migration.zip) to your repository, but `build.gradle`
1. Copy and replace all files from [template](https://github.com/GTNewHorizons/ExampleMod1.7.10/releases/download/master-packages/migration.zip) to your repository, but `build.gradle.kts`
2. Copy all repositories from your `build.gradle(.kts)` to `repositories.gradle`
3. Copy all dependencies from your `build.gradle(.kts)` to `dependecies.gradle`
4. replace your `build.gradle(.kts)` with `build.gradle` from template. In case you have written some custom tasks/configurations not present in the template - move them into `addon.gradle`. It will automatically be integrated if present.
3. Copy all dependencies from your `build.gradle(.kts)` to `dependencies.gradle`
4. replace your `build.gradle(.kts)` with `build.gradle.kts` from template. In case you have written some custom tasks/configurations not present in the template - move them into `addon.gradle`. It will automatically be integrated if present.
5. Adapt `gradle.properties` to your mod
6. Ensure `src/main/resources/mcmod.info` contains `${modId}`, `${modName}`. `${modVersion}` and `${minecraftVersion}`
7. Re-import the project to your IDE (e.g. restart with clean caches in IntelliJ IDEA)
Expand Down
10 changes: 5 additions & 5 deletions docs/porting.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ Try to get rid of dependencies on concrete jars (usually in the `lib` folder) if

Check if they are in maven repository (usually authors put such information in the project readme), if it isn't accessible but project is open source with permissive enough license (e.g., MIT) - you still can publish them yourselves:
1. Fork the repository
2. Drop `jitpack.yml` and `.github/workflows/gradle.yml` in project root. You can find this file in this repository root.
2. Drop `jitpack.yml` and `.github/workflows/build-and-test.yml` in project root. You can find this file in this repository root.
3. Make sure everything builds from console by running `./gradlew clean setupCIWorkspace`
4. If all is fine/after fixing the errors - make a tag on Github or using console, this should trigger Github build hook and generate a release
4. Lookup forked repository on `https://jitpack.io/`
5. Find your release and click "Get it", which should scroll you down to the example of how to add the dependency (make sure you have jitpack repository in mod you are porting)
6. Checkout build log beside button you clicked to make sure it succeeds
5. Lookup forked repository on `https://jitpack.io/`
6. Find your release and click "Get it", which should scroll you down to the example of how to add the dependency (make sure you have jitpack repository in mod you are porting)
7. Checkout build log beside button you clicked to make sure it succeeds

Now when you are sure dependency is available in maven repository - just add it as a normal gradle dependency in `dependencies.gradle`.

Expand Down Expand Up @@ -47,7 +47,7 @@ Good approach is to start working with smaller things first, building up your co
5. Start fixing small things, ones that you think you have most chances to fix and work your way up
6. If any there is any feature that is not worth it's time or you simply don't know how to do it - consider dropping it entirely and open an issue in your repository where you'll explain your findings and blockers.
Maybe somebody with greater knowledge/more time/motivation will try to take bite at it.
9. Fix bugs you've introduced when porting.
7. Fix bugs you've introduced when porting.
It is uncommon for mods to have lots of workarounds and hidden connections.
You'll need to test things and check if they work as intended (gl;hf ;p)

Expand Down
Loading