diff --git a/.gitignore b/.gitignore index daeca8c..fcfcc31 100644 --- a/.gitignore +++ b/.gitignore @@ -43,4 +43,5 @@ bin/ .idea -run/ \ No newline at end of file +run/ +artifacts \ No newline at end of file diff --git a/Forge/build.gradle b/NeoForge/build.gradle similarity index 77% rename from Forge/build.gradle rename to NeoForge/build.gradle index 48e1bb7..fa86fd6 100644 --- a/Forge/build.gradle +++ b/NeoForge/build.gradle @@ -1,5 +1,5 @@ // Adjust the output jar name here -archivesBaseName = "${mod_name}-Forge-${minecraft_version}" +archivesBaseName = "${mod_name}-NeoForge-${minecraft_version}" dependencies { // Add your dependencies here @@ -31,9 +31,12 @@ publishing { */ unimined.minecraft { - minecraftForge { - loader forge_version - mixinConfig("${mod_id}.mixins.json", "${mod_id}-forge.mixins.json") + neoForged { + loader neoforge_version + mixinConfig("${mod_id}.mixins.json", "${mod_id}-neoforge.mixins.json") + + // TODO Remove when NeoGradle is fixed + forgeTransformer.binpatchFile = rootProject.projectDir.toPath().resolve("output.lzma") } } diff --git a/Forge/src/main/java/com/author/examplemod/ExampleModForge.java b/NeoForge/src/main/java/com/author/examplemod/ExampleModForge.java similarity index 53% rename from Forge/src/main/java/com/author/examplemod/ExampleModForge.java rename to NeoForge/src/main/java/com/author/examplemod/ExampleModForge.java index 75e34ef..c1c4dfc 100644 --- a/Forge/src/main/java/com/author/examplemod/ExampleModForge.java +++ b/NeoForge/src/main/java/com/author/examplemod/ExampleModForge.java @@ -1,16 +1,17 @@ package com.author.examplemod; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.event.entity.player.ItemTooltipEvent; -import net.minecraftforge.fml.common.Mod; +import net.neoforged.bus.api.IEventBus; +import net.neoforged.fml.common.Mod; +import net.neoforged.neoforge.common.NeoForge; +import net.neoforged.neoforge.event.entity.player.ItemTooltipEvent; @Mod(ModConstants.MOD_ID) public class ExampleModForge { - public ExampleModForge() { + public ExampleModForge(IEventBus modEventBus) { ModConstants.LOGGER.info("Hello Forge!"); ExampleModCommon.initialize(); - MinecraftForge.EVENT_BUS.addListener(this::onItemTooltip); + NeoForge.EVENT_BUS.addListener(this::onItemTooltip); } private void onItemTooltip(ItemTooltipEvent event) { diff --git a/Forge/src/main/java/com/author/examplemod/mixin/client/ExampleForgeMixin.java b/NeoForge/src/main/java/com/author/examplemod/mixin/client/ExampleForgeMixin.java similarity index 100% rename from Forge/src/main/java/com/author/examplemod/mixin/client/ExampleForgeMixin.java rename to NeoForge/src/main/java/com/author/examplemod/mixin/client/ExampleForgeMixin.java diff --git a/Forge/src/main/java/com/author/examplemod/services/ForgePlatformHelper.java b/NeoForge/src/main/java/com/author/examplemod/services/ForgePlatformHelper.java similarity index 84% rename from Forge/src/main/java/com/author/examplemod/services/ForgePlatformHelper.java rename to NeoForge/src/main/java/com/author/examplemod/services/ForgePlatformHelper.java index a16b887..3c7b17b 100644 --- a/Forge/src/main/java/com/author/examplemod/services/ForgePlatformHelper.java +++ b/NeoForge/src/main/java/com/author/examplemod/services/ForgePlatformHelper.java @@ -1,8 +1,8 @@ package com.author.examplemod.services; import com.author.examplemod.platform.IPlatformHelper; -import net.minecraftforge.fml.ModList; -import net.minecraftforge.fml.loading.FMLLoader; +import net.neoforged.fml.ModList; +import net.neoforged.fml.loading.FMLLoader; public class ForgePlatformHelper implements IPlatformHelper { diff --git a/Forge/src/main/resources/META-INF/mods.toml b/NeoForge/src/main/resources/META-INF/mods.toml similarity index 84% rename from Forge/src/main/resources/META-INF/mods.toml rename to NeoForge/src/main/resources/META-INF/mods.toml index 75a44cc..45b1e55 100644 --- a/Forge/src/main/resources/META-INF/mods.toml +++ b/NeoForge/src/main/resources/META-INF/mods.toml @@ -1,17 +1,17 @@ modLoader="javafml" -loaderVersion="[48,)" +loaderVersion="[1,)" license="MIT" issueTrackerURL="https://github.com/minecraftforge/" [[mods]] -modId="examplemod" +modId="${mod_id}" version="${version}" -displayName="Example Mod" +displayName="${mod_name}" #updateJSONURL="https://change.me.example.invalid/updates.json" displayURL="https://minecraftforge.net" logoFile="assets/examplemod/icon.png" credits="Thanks for this example mod goes to Java" -authors="ExampleAuthor" +authors="${mod_author}" description=''' This is a long form description of the mod. You can write whatever you want here @@ -20,16 +20,16 @@ Have some lorem ipsum. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed mollis lacinia magna. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Sed sagittis luctus odio eu tempus. Interdum et malesuada fames ac ante ipsum primis in faucibus. Pellentesque volutpat ligula eget lacus auctor sagittis. In hac habitasse platea dictumst. Nunc gravida elit vitae sem vehicula efficitur. Donec mattis ipsum et arcu lobortis, eleifend sagittis sem rutrum. Cras pharetra quam eget posuere fermentum. Sed id tincidunt justo. Lorem ipsum dolor sit amet, consectetur adipiscing elit. ''' -[[dependencies.examplemod]] -modId="forge" +[[dependencies.${mod_id}]] +modId="neoforge" mandatory=true -versionRange="[48,)" +versionRange="[20.2,)" ordering="NONE" side="BOTH" -[[dependencies.examplemod]] +[[dependencies.${mod_id}]] modId="minecraft" mandatory=true -versionRange="[1.20.2,)" +versionRange="[1.20.2,1.21)" ordering="NONE" side="BOTH" \ No newline at end of file diff --git a/Forge/src/main/resources/META-INF/services/com.author.examplemod.platform.IPlatformHelper b/NeoForge/src/main/resources/META-INF/services/com.author.examplemod.platform.IPlatformHelper similarity index 100% rename from Forge/src/main/resources/META-INF/services/com.author.examplemod.platform.IPlatformHelper rename to NeoForge/src/main/resources/META-INF/services/com.author.examplemod.platform.IPlatformHelper diff --git a/Forge/src/main/resources/examplemod-forge.mixins.json b/NeoForge/src/main/resources/examplemod-neoforge.mixins.json similarity index 100% rename from Forge/src/main/resources/examplemod-forge.mixins.json rename to NeoForge/src/main/resources/examplemod-neoforge.mixins.json diff --git a/gradle.properties b/gradle.properties index e9b9ba2..e8d91a4 100644 --- a/gradle.properties +++ b/gradle.properties @@ -16,8 +16,9 @@ minecraft_version=1.20.2 fabric_loader=0.14.24 fabric_api=0.90.7+1.20.2 -# Forge -forge_version=48.0.34 +# NeoForged +# Currently 16-beta is the highest version that works, until an issue with NeoGradle is fixed +neoforge_version=16-beta # Gradle Options org.gradle.jvmargs=-Xmx3G diff --git a/output.lzma b/output.lzma new file mode 100644 index 0000000..32747eb Binary files /dev/null and b/output.lzma differ diff --git a/readme.md b/readme.md index 83615a4..1952ff1 100644 --- a/readme.md +++ b/readme.md @@ -20,7 +20,7 @@ This project is powered by [Unimined](https://github.com/unimined/unimined), and 4) `minecraft_version` -> The minecraft version your project targets 5) `fabric_loader` -> The fabric loader version to use. Find this [here](https://fabricmc.net/develop/) 6) `fabric_api` -> The Fabric API for your minecraft version. Find this [here](https://fabricmc.net/develop/) - 7) `forge_version` -> The Forge version for your Minecraft version to use + 7) `neoforge_version` -> The NeoForge version for your Minecraft version to use. For example: `39-beta` 4) Open up `fabric.mod.json` from the Fabric module, and replace the following values: 1) `description` -> Describe what your mod does @@ -31,8 +31,8 @@ This project is powered by [Unimined](https://github.com/unimined/unimined), and 6) `minecraft` -> The minecraft version(s) your mod supports 7) If you do not plan on using mixins, remove the `mixins` section -5) Open up `mods.toml` from the Forge module and replace the following values: - 1) `loaderVersion` -> The forge version code +5) Open up `mods.toml` from the NeoForge module and replace the following values: + 1) `loaderVersion` -> The neoforge version code 2) `license` -> Your mod license 3) `issueTrackerURL` -> Your GitHub repository of the mod 4) `modId` -> Your modid. Make sure to match this with `mod_id` from `gradle.properties` @@ -42,7 +42,7 @@ This project is powered by [Unimined](https://github.com/unimined/unimined), and 8) `authors` -> Your name 9) `description` -> Your mod description 10) `dependencies.examplemod` -> `dependencies.yourmodid` - 11) `versionRange` -> `[forgeVersionCode,)` and `[1.20.2,)` (Replace with the minecraft versions your mod supports) + 11) `versionRange` -> `[neoforgeVersionCode,)` and `[1.20.2,)` (Replace with the minecraft versions your mod supports) 6) If your default JVM/JDK is not Java 17 you will encounter an error when opening the project. This error is fixed by going to File > Settings > Build, Execution, Deployment > Build Tools > Gradle > Gradle JVMand changing the value to a valid Java 17 JVM. You will also need to set the Project SDK to Java 17. This can be done by going to File > Project Structure > Project SDK. Once both have been set open the Gradle tab in IDEA and click the refresh button to reload the project. 7) Replace the contents of `LICENSE` with your mod license @@ -52,9 +52,9 @@ This project is powered by [Unimined](https://github.com/unimined/unimined), and ### Development Guide -When using this template the majority of your mod is developed in the Common project. The Common project is compiled against the vanilla game and is used to hold code that is shared between the different loader-specific versions of your mod. The Common project has no knowledge or access to ModLoader specific code, apis, or concepts. Code that requires something from a specific loader must be done through the project that is specific to that loader, such as the Forge or Fabric project. +When using this template the majority of your mod is developed in the Common project. The Common project is compiled against the vanilla game and is used to hold code that is shared between the different loader-specific versions of your mod. The Common project has no knowledge or access to ModLoader specific code, apis, or concepts. Code that requires something from a specific loader must be done through the project that is specific to that loader, such as the NeoForge or Fabric project. -Loader specific projects such as the Forge and Fabric project are used to load the Common project into the game. These projects also define code that is specific to that loader. Loader specific projects can access all of the code in the Common project. It is important to remember that the Common project can not access code from loader specific projects. +Loader specific projects such as the NeoForge and Fabric project are used to load the Common project into the game. These projects also define code that is specific to that loader. Loader specific projects can access all of the code in the Common project. It is important to remember that the Common project can not access code from loader specific projects. *** diff --git a/settings.gradle b/settings.gradle index 2b73d07..a6c6cb8 100644 --- a/settings.gradle +++ b/settings.gradle @@ -15,5 +15,5 @@ pluginManagement { rootProject.name = 'fdd-xplat' include 'Common' include 'Fabric' -include 'Forge' +include 'NeoForge'