From aa7e2ee86646b3a10f2bc9a76c1d728728c80888 Mon Sep 17 00:00:00 2001 From: Dmytro <13066272+TheElan@users.noreply.github.com> Date: Sun, 7 Nov 2021 17:50:06 +0200 Subject: [PATCH 1/8] add documentation for mod migration --- docs/migration.md | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 docs/migration.md diff --git a/docs/migration.md b/docs/migration.md new file mode 100644 index 0000000..cace1af --- /dev/null +++ b/docs/migration.md @@ -0,0 +1,26 @@ +# Migration guides + +## Generic migration +Migration for the typical mod which doesn't usy anything special but minecraft forge and some library dependencies. +For core plugin, mixins, shadowing, access transformes, 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 to your repository, but: // TODO: (maybe we should have a task in CI which attaches zip with all files but these, called "migration-bundle.zip" or smth) + 1. `build.gradle` + 2. `src` + 3. `LICENSE` + 4. `README.md` + 5. `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 - you'll best to move them to separate file and link it in this, like for example it does this with `dependencies.gradle` +5. Adapt `gradle.properties` to your mod +6. Ensure `src/main/resources/mcmod.info` contains `${modId}`, `${modName}`. `${modVersion}` and `${minecraftVersion}` +7. Run `./gradlew clean setupDecompWorkspace` + +## Mixin configuration +For the reference checkout the [example mixin configuration branch](https://github.com/SinTh0r4s/ExampleMod1.7.10/tree/example-mixins) of the template. + +1. Extract mixins package and plugin configuration from `mixins.yourModId.json` to `gradle.properties` +2. Implement MixinPlugin according to example from the reference +3. Remove mixins.mymodid.json From 2b7cc5b1b12525969f7b86d1f9cd942b84a89926 Mon Sep 17 00:00:00 2001 From: Dmytro <13066272+TheElan@users.noreply.github.com> Date: Sun, 7 Nov 2021 18:24:36 +0200 Subject: [PATCH 2/8] add porting guidlines --- docs/porting.md | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 docs/porting.md diff --git a/docs/porting.md b/docs/porting.md new file mode 100644 index 0000000..7fbd55f --- /dev/null +++ b/docs/porting.md @@ -0,0 +1,31 @@ +# Porting guidelines + +Exact process can vary between different mods. jere is a description of general process which should help you started: +1. Checkout any information in mod REAMDE/Wiki/Docs to find out if there are any special tasks/configs that need to be applied to the build +2. Fork original repository to preserve commit history +3. Apply build migration as explained in [migration guidlines](migration.md) on your fork +4. Try to get rid of dependencies on concrete jars (usually in the `lib` filder) if any present. +If they cannot be found in any maven repo, but are opensource - yyou can publishe them quite easiely. +Fork them and drop `jitpack.yml` frp, template in project root. +Mow jars will be accessible on `https://jitpack.io/` and can be added as a typical gradle dependency (same as your mod). +This way it will be much easier to change (upgrade/downgrade) your project dependencies, when needed. +5. Try to build the project and see check what types of errors are you getting. Generally there should be 2 types of errors you encounter: + - Missing references to packages/classes/methods/fields/parameters. Things get renamed, moved, restructured, removed or even not yet exist. That's the straightforward part - you'll need to adjust references and way things are invoked. + In case of missing things youll either need to implement something that's imitates missing parts or resign from some functionality + - Build related errors (e.g. something that is a part of the mod in never versions previously was a external library - you'll need to add it as a dependencies) +6. Fix all build related errors (so build system won't get in your way) +7. Fix remaining errors. Good approach is to start working with smaller things first, building up your confidence in how the mod works and gradually approaching more complex stuff, here is a general algorithm: + 1. Begin with fixing moved/renamed things by deleting all bad imports and with help of the IDE reimport equivalents if present. + Intelij IDEA you has setting for unumbiguos autoimport and import optimisation on the fly, which can greatly speedup the process. just pay attention to what it's actually imported. + 2. Remove all unworking code which is not easlily fixable (e.g. class is not defined in forge) and provide stubs in it's place (e.g. replacing reference to non existing classes with your class with empty methods). + Do not forget to track all things you've stubbed, if you are working on port alone - TODOs should be sufficient (most IDEs have build in TODO browser). + 3. Build the project and attempt to run it + 4. If there were any critical errors which cause minecraft to crash or mod to not work - try fixing them first, so you can test your changes + 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 worf it's time or you simply don't know how to do it - leave it and open an issue in your repository where you'll explain your findings and blockers. + 7. Maybe somebody with greater knowledge and motivated enough will try to take bite at it. +9. Fix bugs you've introduced when porting. + It's 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) + +Good luck porting it! It's better be worth it! From 4a4f37137892f4cd2cf53e265595404b6252bb8f Mon Sep 17 00:00:00 2001 From: Dmytro <13066272+TheElan@users.noreply.github.com> Date: Sun, 7 Nov 2021 18:31:56 +0200 Subject: [PATCH 3/8] readme: add references to docs; adjust entry ordering --- README.md | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index af60edb..38470b2 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,7 @@ We had our fair share in struggles with build scripts for Minecraft Forge. There ### Getting started +Creating mod from scratch: 1. Fork this repository (you can keep the fork to simplify merging any build script updates in the future) 2. Clone repository 3. Replace placeholders (edit values in gradle.properties, change example package and class names, etc.) @@ -18,6 +19,8 @@ We had our fair share in struggles with build scripts for Minecraft Forge. There 5. Make sure to checkout the rest sections of this file. 6. 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/SinTh0r4s/ExampleMod1.7.10/blob/main/build.gradle) with a newer version @@ -40,23 +43,24 @@ We had our fair share in struggles with build scripts for Minecraft Forge. There - [`jitpack.yml`](https://github.com/SinTh0r4s/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/SinTh0r4s/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. -### Feedback wanted - -If you tried out this build script we would love to head your opinion! Is there any feature missing for you? Did something not work? Please open an issue and we will try to resolve it asap! - ### Forge's Access Transformers You may activate Forge's Access Transformers by defining a configuration file in `gradle.properties`. Check out the [`example-access-transformers`](https://github.com/SinTh0r4s/ExampleMod1.7.10/tree/example-access-transformers) brach for a working example! -### For Advanced Modders: Mixins +### Mixins -You may activate Mixin in 'gradle.properties'. In that case a mixin configuration (usually named `mixins.mymodid.json`) will be generated automatically, and you only have to write the mixins itself. Dependencies are handled as well. -Take a look at the examples in [`com.myname.mymodid.mixinplugin.*`](https://github.com/SinTh0r4s/ExampleMod1.7.10/tree/example-mixins/src/main/java/com/myname/mymodid/mixinplugin) and [`com.myname.mymodid.mixins.*`](https://github.com/SinTh0r4s/ExampleMod1.7.10/tree/example-mixins/src/main/java/com/myname/mymodid/mixins). The use of a MixinPlugin allows the injection into any mod and not just vanilla Minecraft. +Mixins are usually used to modify vanilla or other mod/library from a mod level. For example, redirect a call, change visibility or make class implement your interface. It's an advanced topic and most mods don't need to do that. + +To activate Mixin in 'gradle.properties'. In that case a mixin configuration (usually named `mixins.mymodid.json`) will be generated automatically, and you only have to write the mixins itself. Dependencies are handled as well. +Take a look at the examples in [`com.myname.mymodid.mixinplugin.*`](https://github.com/SinTh0r4s/ExampleMod1.7.10/tree/example-mixins/src/main/java/com/myname/mymodid/mixinplugin) and [`com.myname.mymodid.mixins.*`](https://github.com/SinTh0r4s/ExampleMod1.7.10/tree/example-mixins/src/main/java/com/myname/mymodid/mixins). Check out the [`example-mixins`](https://github.com/SinTh0r4s/ExampleMod1.7.10/tree/example-mixins) brach for a working example! +### Feedback wanted + +If you tried out this build script we would love to head your opinion! Is there any feature missing for you? Did something not work? Please open an issue and we will try to resolve it asap! Happy modding, \ [SinTh0r4s](https://github.com/SinTh0r4s), [TheElan](https://github.com/TheElan) and [basdxz](https://github.com/basdxz) From e13a901f0cd17780059e8158d50076f6de308dc6 Mon Sep 17 00:00:00 2001 From: Dmytro <13066272+TheElan@users.noreply.github.com> Date: Sun, 7 Nov 2021 18:38:28 +0200 Subject: [PATCH 4/8] docs.migration: fix spelling; add reimport step --- docs/migration.md | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/docs/migration.md b/docs/migration.md index cace1af..4b92331 100644 --- a/docs/migration.md +++ b/docs/migration.md @@ -1,11 +1,11 @@ # Migration guides ## Generic migration -Migration for the typical mod which doesn't usy anything special but minecraft forge and some library dependencies. -For core plugin, mixins, shadowing, access transformes, 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. +Migration for the typical mod which doesn't use anything special but Minecraft forge and some library dependencies. +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 to your repository, but: // TODO: (maybe we should have a task in CI which attaches zip with all files but these, called "migration-bundle.zip" or smth) +1. Copy and replace all files from template to your repository, but: 1. `build.gradle` 2. `src` 3. `LICENSE` @@ -16,7 +16,8 @@ If they are missing in this document - we will gladly receive your suggestions/c 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 - you'll best to move them to separate file and link it in this, like for example it does this with `dependencies.gradle` 5. Adapt `gradle.properties` to your mod 6. Ensure `src/main/resources/mcmod.info` contains `${modId}`, `${modName}`. `${modVersion}` and `${minecraftVersion}` -7. Run `./gradlew clean setupDecompWorkspace` +7. Re-import the project to your IDE (e.g. restart with clean caches in IntelliJ IDEA) +8. Run `./gradlew clean setupDecompWorkspace` ## Mixin configuration For the reference checkout the [example mixin configuration branch](https://github.com/SinTh0r4s/ExampleMod1.7.10/tree/example-mixins) of the template. From fa074005f5bcc1195ece2124e7a51a04542f6e9a Mon Sep 17 00:00:00 2001 From: Dmytro <13066272+TheElan@users.noreply.github.com> Date: Sun, 7 Nov 2021 19:26:56 +0200 Subject: [PATCH 5/8] porting: refine structure, fix typos --- docs/porting.md | 77 ++++++++++++++++++++++++++++++++----------------- 1 file changed, 51 insertions(+), 26 deletions(-) diff --git a/docs/porting.md b/docs/porting.md index 7fbd55f..ee6a687 100644 --- a/docs/porting.md +++ b/docs/porting.md @@ -1,31 +1,56 @@ # Porting guidelines -Exact process can vary between different mods. jere is a description of general process which should help you started: +This is a list of steps which should help you on your probably not so easy journey of porting some mod: + +### 1. Setting up repository and build system 1. Checkout any information in mod REAMDE/Wiki/Docs to find out if there are any special tasks/configs that need to be applied to the build 2. Fork original repository to preserve commit history -3. Apply build migration as explained in [migration guidlines](migration.md) on your fork -4. Try to get rid of dependencies on concrete jars (usually in the `lib` filder) if any present. -If they cannot be found in any maven repo, but are opensource - yyou can publishe them quite easiely. -Fork them and drop `jitpack.yml` frp, template in project root. -Mow jars will be accessible on `https://jitpack.io/` and can be added as a typical gradle dependency (same as your mod). -This way it will be much easier to change (upgrade/downgrade) your project dependencies, when needed. -5. Try to build the project and see check what types of errors are you getting. Generally there should be 2 types of errors you encounter: - - Missing references to packages/classes/methods/fields/parameters. Things get renamed, moved, restructured, removed or even not yet exist. That's the straightforward part - you'll need to adjust references and way things are invoked. - In case of missing things youll either need to implement something that's imitates missing parts or resign from some functionality - - Build related errors (e.g. something that is a part of the mod in never versions previously was a external library - you'll need to add it as a dependencies) -6. Fix all build related errors (so build system won't get in your way) -7. Fix remaining errors. Good approach is to start working with smaller things first, building up your confidence in how the mod works and gradually approaching more complex stuff, here is a general algorithm: - 1. Begin with fixing moved/renamed things by deleting all bad imports and with help of the IDE reimport equivalents if present. - Intelij IDEA you has setting for unumbiguos autoimport and import optimisation on the fly, which can greatly speedup the process. just pay attention to what it's actually imported. - 2. Remove all unworking code which is not easlily fixable (e.g. class is not defined in forge) and provide stubs in it's place (e.g. replacing reference to non existing classes with your class with empty methods). - Do not forget to track all things you've stubbed, if you are working on port alone - TODOs should be sufficient (most IDEs have build in TODO browser). - 3. Build the project and attempt to run it - 4. If there were any critical errors which cause minecraft to crash or mod to not work - try fixing them first, so you can test your changes - 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 worf it's time or you simply don't know how to do it - leave it and open an issue in your repository where you'll explain your findings and blockers. - 7. Maybe somebody with greater knowledge and motivated enough will try to take bite at it. -9. Fix bugs you've introduced when porting. - It's 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) +3. Apply build migration as explained in [migration guidelines](migration.md) on your fork -Good luck porting it! It's better be worth it! +### 2. Refining the fork +Try to get rid of dependencies on concrete jars (usually in the `lib` folder) if any present. This way it will be much easier to change (upgrade/downgrade) your project dependencies, when needed. + +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. + 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 succeed + +Now, having dependency string you can just plug it into dependencies + +If you can't find any source code of the lib, don't despair, there is still a chance to distribute it. If original author has not restricted the distribution permissions (hence the jar ended up in repository of the mod you are porting) or you managed to obtain their permission - you can just upload it as a jar to jitpack, see [jitpack single file publishing thread](https://gist.github.com/jitpack-io/f928a858aa5da08ad9d9662f982da983) for that. + +There also may be a case where mod depends on another mod - then you'll need to port it first. (Yay, dependency hell! :D) + +### 3. Preparing for porting +Try to build the project and see check what types of errors are you getting. Generally there should be 2 types of errors you encounter: + - Missing references to packages/classes/methods/fields/parameters. Things get renamed, moved, restructured, removed or even not yet exist. That's the straightforward part - you'll need to adjust references and way things are invoked. + In case of missing things you'll either need to implement something that's imitates missing parts or resign from some functionality + - Build related errors (e.g. something that is a part of the mod in never versions previously was a external library - you'll need to add it as a dependencies) + +Fix all build related errors (so build system won't get in your way) + +### 4. Porting the mod +After all these preparation nothing should be in the way of porting the mod, the only thing left is the actual code to change, which probably is a most tedious part of this process. + +Good approach is to start working with smaller things first, building up your confidence in how the mod works and gradually approaching more complex stuff, here is a general algorithm: + 1. Begin with fixing moved/renamed things by deleting all bad imports and with help of the IDE re-import equivalents if present. + Intelij IDEA you has setting for unambiguous auto-import and import optimization on the fly, which can greatly speedup the process. just pay attention to what it's actually imported. + 2. Remove all nonworking code which is not easily fixable (e.g. class only introduced in newer forge) and provide stubs in it's place. + For example replace reference to method of non existing class with your method in your class, it can have an empty body and mocked return so the code can compile and run without issues. + Do not forget to track all things you've stubbed, if you are working on port alone - TODOs should be sufficient (most IDEs have build in TODO browser). + 3. Build the project and attempt to run it + 4. If there were any critical errors which cause Minecraft to crash or mod to not work - try fixing them first, so you can test your changes + 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. + It's 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) + +### 5. Final words + +If after reading this you are not discouraged and still want to port it - good luck porting it! You'll defiently need it. From 715d3823e33a64d596b549b5059381ef53dc3892 Mon Sep 17 00:00:00 2001 From: Dmytro <13066272+TheElan@users.noreply.github.com> Date: Sun, 7 Nov 2021 19:28:11 +0200 Subject: [PATCH 6/8] readme: clarify mixin section description --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 38470b2..d854149 100644 --- a/README.md +++ b/README.md @@ -51,7 +51,7 @@ Check out the [`example-access-transformers`](https://github.com/SinTh0r4s/Examp ### Mixins -Mixins are usually used to modify vanilla or other mod/library from a mod level. For example, redirect a call, change visibility or make class implement your interface. It's an advanced topic and most mods don't need to do that. +Mixins are usually used to modify vanilla or mod/library in runtime without having to change source code. For example, redirect a call, change visibility or make class implement your interface. It's an advanced topic and most mods don't need to do that. To activate Mixin in 'gradle.properties'. In that case a mixin configuration (usually named `mixins.mymodid.json`) will be generated automatically, and you only have to write the mixins itself. Dependencies are handled as well. Take a look at the examples in [`com.myname.mymodid.mixinplugin.*`](https://github.com/SinTh0r4s/ExampleMod1.7.10/tree/example-mixins/src/main/java/com/myname/mymodid/mixinplugin) and [`com.myname.mymodid.mixins.*`](https://github.com/SinTh0r4s/ExampleMod1.7.10/tree/example-mixins/src/main/java/com/myname/mymodid/mixins). From 89dfa2df4a3930cfd3aaf8e975f6922aa151ac17 Mon Sep 17 00:00:00 2001 From: Dmytro <13066272+TheElan@users.noreply.github.com> Date: Sun, 7 Nov 2021 19:58:54 +0200 Subject: [PATCH 7/8] readme: fix typo in mixin config section --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d854149..3bef3f5 100644 --- a/README.md +++ b/README.md @@ -53,7 +53,7 @@ Check out the [`example-access-transformers`](https://github.com/SinTh0r4s/Examp Mixins are usually used to modify vanilla or mod/library in runtime without having to change source code. For example, redirect a call, change visibility or make class implement your interface. It's an advanced topic and most mods don't need to do that. -To activate Mixin in 'gradle.properties'. In that case a mixin configuration (usually named `mixins.mymodid.json`) will be generated automatically, and you only have to write the mixins itself. Dependencies are handled as well. +You can activate Mixin in 'gradle.properties'. In that case a mixin configuration (usually named `mixins.mymodid.json`) will be generated automatically, and you only have to write the mixins itself. Dependencies are handled as well. Take a look at the examples in [`com.myname.mymodid.mixinplugin.*`](https://github.com/SinTh0r4s/ExampleMod1.7.10/tree/example-mixins/src/main/java/com/myname/mymodid/mixinplugin) and [`com.myname.mymodid.mixins.*`](https://github.com/SinTh0r4s/ExampleMod1.7.10/tree/example-mixins/src/main/java/com/myname/mymodid/mixins). Check out the [`example-mixins`](https://github.com/SinTh0r4s/ExampleMod1.7.10/tree/example-mixins) brach for a working example! From d8ffb29cd448542ac3dd6605b8bb47cd2c633eb6 Mon Sep 17 00:00:00 2001 From: Dmytro <13066272+TheElan@users.noreply.github.com> Date: Sun, 7 Nov 2021 20:23:48 +0200 Subject: [PATCH 8/8] porting: fix syntax and grammar tx SinTh0r4s --- docs/porting.md | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/docs/porting.md b/docs/porting.md index ee6a687..28de4af 100644 --- a/docs/porting.md +++ b/docs/porting.md @@ -10,47 +10,47 @@ This is a list of steps which should help you on your probably not so easy journ ### 2. Refining the fork Try to get rid of dependencies on concrete jars (usually in the `lib` folder) if any present. This way it will be much easier to change (upgrade/downgrade) your project dependencies, when needed. -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: +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. 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 succeed + 6. Checkout build log beside button you clicked to make sure it succeeds -Now, having dependency string you can just plug it into dependencies +Now when you are sure dependency is available in maven repository - just add it as a normal gradle dependency in `dependencies.gradle`. -If you can't find any source code of the lib, don't despair, there is still a chance to distribute it. If original author has not restricted the distribution permissions (hence the jar ended up in repository of the mod you are porting) or you managed to obtain their permission - you can just upload it as a jar to jitpack, see [jitpack single file publishing thread](https://gist.github.com/jitpack-io/f928a858aa5da08ad9d9662f982da983) for that. +If there is not online dependency available, you may upload it as a jar to jitpack, see [jitpack single file publishing thread](https://gist.github.com/jitpack-io/f928a858aa5da08ad9d9662f982da983). Please ensure, that you have the rights to do so! -There also may be a case where mod depends on another mod - then you'll need to port it first. (Yay, dependency hell! :D) +There may also be a case where mods depend on another mods - then you'll need to port any dependencies first. (Yay, dependency hell! :D) ### 3. Preparing for porting -Try to build the project and see check what types of errors are you getting. Generally there should be 2 types of errors you encounter: +Try to build the project and see check what types of errors are you getting. Generally, there should be 2 types of errors you encounter: - Missing references to packages/classes/methods/fields/parameters. Things get renamed, moved, restructured, removed or even not yet exist. That's the straightforward part - you'll need to adjust references and way things are invoked. - In case of missing things you'll either need to implement something that's imitates missing parts or resign from some functionality - - Build related errors (e.g. something that is a part of the mod in never versions previously was a external library - you'll need to add it as a dependencies) + In case of missing things, you'll either need to implement something that's imitates missing parts or resign from some functionality + - Build related errors (e.g., something that is a part of the mod in never versions previously was an external library - you'll need to add it as a dependencies) Fix all build related errors (so build system won't get in your way) ### 4. Porting the mod -After all these preparation nothing should be in the way of porting the mod, the only thing left is the actual code to change, which probably is a most tedious part of this process. +After all these preparations nothing should be in the way of porting the mod, the only thing left is the actual code to change, which probably is a most tedious part of this process. Good approach is to start working with smaller things first, building up your confidence in how the mod works and gradually approaching more complex stuff, here is a general algorithm: 1. Begin with fixing moved/renamed things by deleting all bad imports and with help of the IDE re-import equivalents if present. - Intelij IDEA you has setting for unambiguous auto-import and import optimization on the fly, which can greatly speedup the process. just pay attention to what it's actually imported. - 2. Remove all nonworking code which is not easily fixable (e.g. class only introduced in newer forge) and provide stubs in it's place. - For example replace reference to method of non existing class with your method in your class, it can have an empty body and mocked return so the code can compile and run without issues. - Do not forget to track all things you've stubbed, if you are working on port alone - TODOs should be sufficient (most IDEs have build in TODO browser). + Intelij IDEA has settings for unambiguous auto-import and import optimization on the fly, which can greatly speedup the process. Just pay attention to what is actually imported. + 2. Remove all nonworking code which is not easily fixable (e.g., class only introduced in newer forge) and provide stubs in its place. + For example, replace reference to method of non existing class with your method in your class, it can have an empty body and mocked return so the code can compile and run without issues. + Do not forget to track all things you've stubbed, if you are working on port alone - TODOs should be sufficient (most IDEs have a built in TODO browser). 3. Build the project and attempt to run it 4. If there were any critical errors which cause Minecraft to crash or mod to not work - try fixing them first, so you can test your changes 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. - It's is uncommon for mods to have lots of workarounds and hidden connections. + 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) ### 5. Final words -If after reading this you are not discouraged and still want to port it - good luck porting it! You'll defiently need it. +If after reading this, you are not discouraged and still want to port it - good luck porting it! You'll definitively need it.