├── .gitignore ├── Common ├── build.gradle └── src │ └── main │ ├── java │ └── com │ │ └── author │ │ └── examplemod │ │ ├── ExampleModCommon.java │ │ ├── ModConstants.java │ │ ├── mixin │ │ └── client │ │ │ └── ExampleMixin.java │ │ └── platform │ │ ├── IPlatformHelper.java │ │ └── ImplLoader.java │ └── resources │ ├── examplemod.mixins.json │ └── pack.mcmeta ├── Fabric ├── build.gradle └── src │ └── main │ ├── java │ └── com │ │ └── author │ │ └── examplemod │ │ ├── ExampleFabricMod.java │ │ ├── mixin │ │ └── client │ │ │ └── ExampleFabricMixin.java │ │ └── platform │ │ └── FabricPlatformHelper.java │ └── resources │ ├── META-INF │ └── services │ │ └── com.author.examplemod.platform.IPlatformHelper │ ├── examplemod-fabric.mixins.json │ └── fabric.mod.json ├── LICENSE ├── NeoForge ├── build.gradle └── src │ └── main │ ├── java │ └── com │ │ └── author │ │ └── examplemod │ │ ├── ExampleModForge.java │ │ ├── mixin │ │ └── client │ │ │ └── ExampleForgeMixin.java │ │ └── services │ │ └── ForgePlatformHelper.java │ └── resources │ ├── META-INF │ ├── neoforge.mods.toml │ └── services │ │ └── com.author.examplemod.platform.IPlatformHelper │ └── examplemod-neoforge.mixins.json ├── build.gradle ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── readme.md └── settings.gradle /.gitignore: -------------------------------------------------------------------------------- 1 | .gradle 2 | build/ 3 | !gradle/wrapper/gradle-wrapper.jar 4 | !**/src/main/**/build/ 5 | !**/src/test/**/build/ 6 | 7 | ### IntelliJ IDEA ### 8 | .idea/modules.xml 9 | .idea/jarRepositories.xml 10 | .idea/compiler.xml 11 | .idea/libraries/ 12 | *.iws 13 | *.iml 14 | *.ipr 15 | out/ 16 | !**/src/main/**/out/ 17 | !**/src/test/**/out/ 18 | 19 | ### Eclipse ### 20 | .apt_generated 21 | .classpath 22 | .factorypath 23 | .project 24 | .settings 25 | .springBeans 26 | .sts4-cache 27 | bin/ 28 | !**/src/main/**/bin/ 29 | !**/src/test/**/bin/ 30 | 31 | ### NetBeans ### 32 | /nbproject/private/ 33 | /nbbuild/ 34 | /dist/ 35 | /nbdist/ 36 | /.nb-gradle/ 37 | 38 | ### VS Code ### 39 | .vscode/ 40 | 41 | ### Mac OS ### 42 | .DS_Store 43 | 44 | .idea 45 | 46 | run/ 47 | artifacts -------------------------------------------------------------------------------- /Common/build.gradle: -------------------------------------------------------------------------------- 1 | // Adjust the output jar name here 2 | archivesBaseName = "${mod_name}-Common-${minecraft_version}" 3 | 4 | dependencies { 5 | // Add your dependencies here 6 | } 7 | 8 | // Maven Publishing. Remove if not needed 9 | publishing { 10 | publications { 11 | mavenJava(MavenPublication) { 12 | artifactId base.archivesName.get() 13 | from components.java 14 | } 15 | } 16 | repositories { 17 | // Add your maven repository here 18 | maven { 19 | url "file://" + System.getenv("local_maven") 20 | } 21 | } 22 | } 23 | 24 | /** 25 | * =============================================================================== 26 | * = DO NOT EDIT BELOW THIS LINE UNLESS YOU KNOW WHAT YOU ARE DOING = 27 | * =============================================================================== 28 | */ 29 | 30 | unimined.minecraft { 31 | fabric { 32 | loader fabric_loader 33 | } 34 | 35 | defaultRemapJar = false 36 | } 37 | 38 | processResources { 39 | def buildProps = project.properties.clone() 40 | 41 | filesMatching(['pack.mcmeta']) { 42 | expand buildProps 43 | } 44 | } -------------------------------------------------------------------------------- /Common/src/main/java/com/author/examplemod/ExampleModCommon.java: -------------------------------------------------------------------------------- 1 | package com.author.examplemod; 2 | 3 | import com.author.examplemod.platform.IPlatformHelper; 4 | import net.minecraft.core.registries.BuiltInRegistries; 5 | import net.minecraft.network.chat.Component; 6 | import net.minecraft.world.item.Item; 7 | import net.minecraft.world.item.ItemStack; 8 | import net.minecraft.world.item.Items; 9 | import net.minecraft.world.item.TooltipFlag; 10 | 11 | import java.util.List; 12 | 13 | public class ExampleModCommon { 14 | 15 | public static void initialize() { 16 | ModConstants.LOGGER.info("Hello from Common init on {}! we are currently in a {} environment!", IPlatformHelper.INSTANCE.getPlatformName(), IPlatformHelper.INSTANCE.isDevelopmentEnvironment() ? "development" : "production"); 17 | ModConstants.LOGGER.info("Diamond Item >> {}", BuiltInRegistries.ITEM.getKey(Items.DIAMOND)); 18 | } 19 | 20 | // This method serves as a hook to modify item tooltips. The vanilla game 21 | // has no mechanism to load tooltip listeners so this must be registered 22 | // by a mod loader like Forge or Fabric. 23 | public static void onItemTooltip(ItemStack stack, Item.TooltipContext context, TooltipFlag flag, List tooltip) { 24 | if (!stack.isEmpty()) { 25 | tooltip.add(Component.literal("Hey you!")); 26 | } 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /Common/src/main/java/com/author/examplemod/ModConstants.java: -------------------------------------------------------------------------------- 1 | package com.author.examplemod; 2 | 3 | import org.apache.logging.log4j.LogManager; 4 | import org.apache.logging.log4j.Logger; 5 | 6 | public class ModConstants { 7 | 8 | public static final String MOD_ID = "examplemod"; 9 | public static final Logger LOGGER = LogManager.getLogger(MOD_ID); 10 | 11 | } -------------------------------------------------------------------------------- /Common/src/main/java/com/author/examplemod/mixin/client/ExampleMixin.java: -------------------------------------------------------------------------------- 1 | package com.author.examplemod.mixin.client; 2 | 3 | import com.author.examplemod.ModConstants; 4 | import net.minecraft.client.gui.screens.TitleScreen; 5 | import org.spongepowered.asm.mixin.Mixin; 6 | import org.spongepowered.asm.mixin.injection.At; 7 | import org.spongepowered.asm.mixin.injection.Inject; 8 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 9 | 10 | @Mixin(TitleScreen.class) 11 | public class ExampleMixin { 12 | 13 | @Inject(at = @At("HEAD"), method = "init()V") 14 | private void init(CallbackInfo ci) { 15 | ModConstants.LOGGER.info("This line is printed by a mixin from Common!"); 16 | } 17 | 18 | } -------------------------------------------------------------------------------- /Common/src/main/java/com/author/examplemod/platform/IPlatformHelper.java: -------------------------------------------------------------------------------- 1 | package com.author.examplemod.platform; 2 | 3 | public interface IPlatformHelper { 4 | IPlatformHelper INSTANCE = ImplLoader.load(IPlatformHelper.class); 5 | 6 | /** 7 | * Gets the name of the current platform 8 | * 9 | * @return The name of the current platform. 10 | */ 11 | String getPlatformName(); 12 | 13 | /** 14 | * Checks if a mod with the given id is loaded. 15 | * 16 | * @param modId The mod to check if it is loaded. 17 | * @return True if the mod is loaded, false otherwise. 18 | */ 19 | boolean isModLoaded(String modId); 20 | 21 | /** 22 | * Check if the game is currently in a development environment. 23 | * 24 | * @return True if in a development environment, false otherwise. 25 | */ 26 | boolean isDevelopmentEnvironment(); 27 | } -------------------------------------------------------------------------------- /Common/src/main/java/com/author/examplemod/platform/ImplLoader.java: -------------------------------------------------------------------------------- 1 | package com.author.examplemod.platform; 2 | 3 | import java.util.ServiceLoader; 4 | 5 | public class ImplLoader { 6 | public static T load(Class clazz) { 7 | return ServiceLoader.load(clazz) 8 | .findFirst() 9 | .orElseThrow(() -> new NullPointerException("Failed to load service for " + clazz.getName())); 10 | } 11 | } -------------------------------------------------------------------------------- /Common/src/main/resources/examplemod.mixins.json: -------------------------------------------------------------------------------- 1 | { 2 | "required": true, 3 | "minVersion": "0.8", 4 | "package": "com.author.examplemod.mixin", 5 | "compatibilityLevel": "JAVA_17", 6 | "mixins": [ 7 | ], 8 | "client": [ 9 | "client.ExampleMixin" 10 | ], 11 | "server": [ 12 | ], 13 | "injectors": { 14 | "defaultRequire": 1 15 | } 16 | } -------------------------------------------------------------------------------- /Common/src/main/resources/pack.mcmeta: -------------------------------------------------------------------------------- 1 | { 2 | "pack": { 3 | "description": "${mod_id}", 4 | "pack_format": 12 5 | } 6 | } -------------------------------------------------------------------------------- /Fabric/build.gradle: -------------------------------------------------------------------------------- 1 | // Adjust the output jar name here 2 | archivesBaseName = "${mod_name}-Fabric-${minecraft_version}" 3 | 4 | dependencies { 5 | // Add your own dependencies here 6 | 7 | // Fabric API. Can be removed if not needed 8 | modImplementation "net.fabricmc.fabric-api:fabric-api:${fabric_api}" 9 | 10 | // Do not remove or edit! 11 | implementation(project(":Common")) 12 | } 13 | 14 | // Maven Publishing. Remove if not needed 15 | publishing { 16 | publications { 17 | mavenJava(MavenPublication) { 18 | artifactId base.archivesName.get() 19 | from components.java 20 | } 21 | } 22 | repositories { 23 | // Add your maven repository here 24 | maven { 25 | url "file://" + System.getenv("local_maven") 26 | } 27 | } 28 | } 29 | 30 | /** 31 | * =============================================================================== 32 | * = DO NOT EDIT BELOW THIS LINE UNLESS YOU KNOW WHAT YOU ARE DOING = 33 | * =============================================================================== 34 | */ 35 | 36 | unimined.minecraft { 37 | fabric { 38 | loader fabric_loader 39 | } 40 | } 41 | 42 | processResources { 43 | from project(":Common").sourceSets.main.resources 44 | def buildProps = project.properties.clone() 45 | 46 | filesMatching(['fabric.mod.json']) { 47 | expand buildProps 48 | } 49 | } 50 | 51 | compileTestJava.enabled = false 52 | 53 | tasks.withType(JavaCompile).configureEach { 54 | source(project(":Common").sourceSets.main.allSource) 55 | } -------------------------------------------------------------------------------- /Fabric/src/main/java/com/author/examplemod/ExampleFabricMod.java: -------------------------------------------------------------------------------- 1 | package com.author.examplemod; 2 | 3 | import net.fabricmc.api.ModInitializer; 4 | import net.fabricmc.fabric.api.client.item.v1.ItemTooltipCallback; 5 | 6 | public class ExampleFabricMod implements ModInitializer { 7 | 8 | @Override 9 | public void onInitialize() { 10 | ModConstants.LOGGER.info("Hello Fabric!"); 11 | ExampleModCommon.initialize(); 12 | ItemTooltipCallback.EVENT.register(ExampleModCommon::onItemTooltip); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Fabric/src/main/java/com/author/examplemod/mixin/client/ExampleFabricMixin.java: -------------------------------------------------------------------------------- 1 | package com.author.examplemod.mixin.client; 2 | 3 | import com.author.examplemod.ModConstants; 4 | import net.minecraft.client.gui.screens.TitleScreen; 5 | import org.spongepowered.asm.mixin.Mixin; 6 | import org.spongepowered.asm.mixin.injection.At; 7 | import org.spongepowered.asm.mixin.injection.Inject; 8 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 9 | 10 | @Mixin(TitleScreen.class) 11 | public class ExampleFabricMixin { 12 | 13 | @Inject(at = @At("HEAD"), method = "init()V") 14 | private void init(CallbackInfo ci) { 15 | ModConstants.LOGGER.info("This line is printed by a mixin from Fabric!"); 16 | } 17 | 18 | } -------------------------------------------------------------------------------- /Fabric/src/main/java/com/author/examplemod/platform/FabricPlatformHelper.java: -------------------------------------------------------------------------------- 1 | package com.author.examplemod.platform; 2 | 3 | import net.fabricmc.loader.api.FabricLoader; 4 | 5 | public class FabricPlatformHelper implements IPlatformHelper { 6 | 7 | @Override 8 | public String getPlatformName() { 9 | return "Fabric"; 10 | } 11 | 12 | @Override 13 | public boolean isModLoaded(String modId) { 14 | return FabricLoader.getInstance().isModLoaded(modId); 15 | } 16 | 17 | @Override 18 | public boolean isDevelopmentEnvironment() { 19 | return FabricLoader.getInstance().isDevelopmentEnvironment(); 20 | } 21 | } -------------------------------------------------------------------------------- /Fabric/src/main/resources/META-INF/services/com.author.examplemod.platform.IPlatformHelper: -------------------------------------------------------------------------------- 1 | com.author.examplemod.platform.FabricPlatformHelper -------------------------------------------------------------------------------- /Fabric/src/main/resources/examplemod-fabric.mixins.json: -------------------------------------------------------------------------------- 1 | { 2 | "required": true, 3 | "minVersion": "0.8", 4 | "package": "com.author.examplemod.mixin", 5 | "compatibilityLevel": "JAVA_17", 6 | "mixins": [ 7 | ], 8 | "client": [ 9 | "client.ExampleFabricMixin" 10 | ], 11 | "server": [ 12 | ], 13 | "injectors": { 14 | "defaultRequire": 1 15 | } 16 | } -------------------------------------------------------------------------------- /Fabric/src/main/resources/fabric.mod.json: -------------------------------------------------------------------------------- 1 | { 2 | "schemaVersion": 1, 3 | "id": "${mod_id}", 4 | "version": "${version}", 5 | "name": "${mod_name}", 6 | "description": "This is an example description! Tell everyone what your mod is about!", 7 | "authors": [ 8 | "${mod_author}" 9 | ], 10 | "contact": { 11 | "homepage": "https://fabricmc.net/", 12 | "sources": "https://github.com/fabricmc/" 13 | }, 14 | "license": "MIT", 15 | "icon": "assets/examplemod/icon.png", 16 | "environment": "*", 17 | "entrypoints": { 18 | "main": [ 19 | "com.author.examplemod.ExampleFabricMod" 20 | ] 21 | }, 22 | "mixins": [ 23 | "examplemod.mixins.json", 24 | "examplemod-fabric.mixins.json" 25 | ], 26 | "depends": { 27 | "fabricloader": ">=0.14", 28 | "fabric": "*", 29 | "minecraft": ">=1.21", 30 | "java": ">=21" 31 | } 32 | } -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Creative Commons Legal Code 2 | 3 | CC0 1.0 Universal 4 | 5 | CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE 6 | LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN 7 | ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS 8 | INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES 9 | REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS 10 | PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM 11 | THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED 12 | HEREUNDER. 13 | 14 | Statement of Purpose 15 | 16 | The laws of most jurisdictions throughout the world automatically confer 17 | exclusive Copyright and Related Rights (defined below) upon the creator 18 | and subsequent owner(s) (each and all, an "owner") of an original work of 19 | authorship and/or a database (each, a "Work"). 20 | 21 | Certain owners wish to permanently relinquish those rights to a Work for 22 | the purpose of contributing to a commons of creative, cultural and 23 | scientific works ("Commons") that the public can reliably and without fear 24 | of later claims of infringement build upon, modify, incorporate in other 25 | works, reuse and redistribute as freely as possible in any form whatsoever 26 | and for any purposes, including without limitation commercial purposes. 27 | These owners may contribute to the Commons to promote the ideal of a free 28 | culture and the further production of creative, cultural and scientific 29 | works, or to gain reputation or greater distribution for their Work in 30 | part through the use and efforts of others. 31 | 32 | For these and/or other purposes and motivations, and without any 33 | expectation of additional consideration or compensation, the person 34 | associating CC0 with a Work (the "Affirmer"), to the extent that he or she 35 | is an owner of Copyright and Related Rights in the Work, voluntarily 36 | elects to apply CC0 to the Work and publicly distribute the Work under its 37 | terms, with knowledge of his or her Copyright and Related Rights in the 38 | Work and the meaning and intended legal effect of CC0 on those rights. 39 | 40 | 1. Copyright and Related Rights. A Work made available under CC0 may be 41 | protected by copyright and related or neighboring rights ("Copyright and 42 | Related Rights"). Copyright and Related Rights include, but are not 43 | limited to, the following: 44 | 45 | i. the right to reproduce, adapt, distribute, perform, display, 46 | communicate, and translate a Work; 47 | ii. moral rights retained by the original author(s) and/or performer(s); 48 | iii. publicity and privacy rights pertaining to a person's image or 49 | likeness depicted in a Work; 50 | iv. rights protecting against unfair competition in regards to a Work, 51 | subject to the limitations in paragraph 4(a), below; 52 | v. rights protecting the extraction, dissemination, use and reuse of data 53 | in a Work; 54 | vi. database rights (such as those arising under Directive 96/9/EC of the 55 | European Parliament and of the Council of 11 March 1996 on the legal 56 | protection of databases, and under any national implementation 57 | thereof, including any amended or successor version of such 58 | directive); and 59 | vii. other similar, equivalent or corresponding rights throughout the 60 | world based on applicable law or treaty, and any national 61 | implementations thereof. 62 | 63 | 2. Waiver. To the greatest extent permitted by, but not in contravention 64 | of, applicable law, Affirmer hereby overtly, fully, permanently, 65 | irrevocably and unconditionally waives, abandons, and surrenders all of 66 | Affirmer's Copyright and Related Rights and associated claims and causes 67 | of action, whether now known or unknown (including existing as well as 68 | future claims and causes of action), in the Work (i) in all territories 69 | worldwide, (ii) for the maximum duration provided by applicable law or 70 | treaty (including future time extensions), (iii) in any current or future 71 | medium and for any number of copies, and (iv) for any purpose whatsoever, 72 | including without limitation commercial, advertising or promotional 73 | purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each 74 | member of the public at large and to the detriment of Affirmer's heirs and 75 | successors, fully intending that such Waiver shall not be subject to 76 | revocation, rescission, cancellation, termination, or any other legal or 77 | equitable action to disrupt the quiet enjoyment of the Work by the public 78 | as contemplated by Affirmer's express Statement of Purpose. 79 | 80 | 3. Public License Fallback. Should any part of the Waiver for any reason 81 | be judged legally invalid or ineffective under applicable law, then the 82 | Waiver shall be preserved to the maximum extent permitted taking into 83 | account Affirmer's express Statement of Purpose. In addition, to the 84 | extent the Waiver is so judged Affirmer hereby grants to each affected 85 | person a royalty-free, non transferable, non sublicensable, non exclusive, 86 | irrevocable and unconditional license to exercise Affirmer's Copyright and 87 | Related Rights in the Work (i) in all territories worldwide, (ii) for the 88 | maximum duration provided by applicable law or treaty (including future 89 | time extensions), (iii) in any current or future medium and for any number 90 | of copies, and (iv) for any purpose whatsoever, including without 91 | limitation commercial, advertising or promotional purposes (the 92 | "License"). The License shall be deemed effective as of the date CC0 was 93 | applied by Affirmer to the Work. Should any part of the License for any 94 | reason be judged legally invalid or ineffective under applicable law, such 95 | partial invalidity or ineffectiveness shall not invalidate the remainder 96 | of the License, and in such case Affirmer hereby affirms that he or she 97 | will not (i) exercise any of his or her remaining Copyright and Related 98 | Rights in the Work or (ii) assert any associated claims and causes of 99 | action with respect to the Work, in either case contrary to Affirmer's 100 | express Statement of Purpose. 101 | 102 | 4. Limitations and Disclaimers. 103 | 104 | a. No trademark or patent rights held by Affirmer are waived, abandoned, 105 | surrendered, licensed or otherwise affected by this document. 106 | b. Affirmer offers the Work as-is and makes no representations or 107 | warranties of any kind concerning the Work, express, implied, 108 | statutory or otherwise, including without limitation warranties of 109 | title, merchantability, fitness for a particular purpose, non 110 | infringement, or the absence of latent or other defects, accuracy, or 111 | the present or absence of errors, whether or not discoverable, all to 112 | the greatest extent permissible under applicable law. 113 | c. Affirmer disclaims responsibility for clearing rights of other persons 114 | that may apply to the Work or any use thereof, including without 115 | limitation any person's Copyright and Related Rights in the Work. 116 | Further, Affirmer disclaims responsibility for obtaining any necessary 117 | consents, permissions or other rights required for any use of the 118 | Work. 119 | d. Affirmer understands and acknowledges that Creative Commons is not a 120 | party to this document and has no duty or obligation with respect to 121 | this CC0 or use of the Work. 122 | -------------------------------------------------------------------------------- /NeoForge/build.gradle: -------------------------------------------------------------------------------- 1 | // Adjust the output jar name here 2 | archivesBaseName = "${mod_name}-NeoForge-${minecraft_version}" 3 | 4 | dependencies { 5 | // Add your dependencies here 6 | 7 | // Do not edit or remove 8 | implementation project(":Common") 9 | } 10 | 11 | // Maven Publishing. Remove if not needed 12 | publishing { 13 | publications { 14 | mavenJava(MavenPublication) { 15 | artifactId base.archivesName.get() 16 | from components.java 17 | } 18 | } 19 | repositories { 20 | // Add your maven repository here 21 | maven { 22 | url "file://" + System.getenv("local_maven") 23 | } 24 | } 25 | } 26 | 27 | /** 28 | * =============================================================================== 29 | * = DO NOT EDIT BELOW THIS LINE UNLESS YOU KNOW WHAT YOU ARE DOING = 30 | * =============================================================================== 31 | */ 32 | 33 | unimined.minecraft { 34 | neoForged { 35 | loader neoforge_version 36 | mixinConfig("${mod_id}.mixins.json", "${mod_id}-neoforge.mixins.json") 37 | } 38 | } 39 | 40 | processResources { 41 | from project(":Common").sourceSets.main.resources 42 | def buildProps = project.properties.clone() 43 | 44 | filesMatching("META-INF/neoforge.mods.toml") { 45 | expand buildProps 46 | } 47 | } 48 | 49 | compileTestJava.enabled = false 50 | 51 | tasks.withType(JavaCompile).configureEach { 52 | source(project(":Common").sourceSets.main.allSource) 53 | } -------------------------------------------------------------------------------- /NeoForge/src/main/java/com/author/examplemod/ExampleModForge.java: -------------------------------------------------------------------------------- 1 | package com.author.examplemod; 2 | 3 | import net.neoforged.bus.api.IEventBus; 4 | import net.neoforged.fml.common.Mod; 5 | import net.neoforged.neoforge.common.NeoForge; 6 | import net.neoforged.neoforge.event.entity.player.ItemTooltipEvent; 7 | 8 | @Mod(ModConstants.MOD_ID) 9 | public class ExampleModForge { 10 | 11 | public ExampleModForge(IEventBus modEventBus) { 12 | ModConstants.LOGGER.info("Hello Forge!"); 13 | ExampleModCommon.initialize(); 14 | NeoForge.EVENT_BUS.addListener(this::onItemTooltip); 15 | } 16 | 17 | private void onItemTooltip(ItemTooltipEvent event) { 18 | ExampleModCommon.onItemTooltip(event.getItemStack(), event.getContext(), event.getFlags(), event.getToolTip()); 19 | } 20 | } -------------------------------------------------------------------------------- /NeoForge/src/main/java/com/author/examplemod/mixin/client/ExampleForgeMixin.java: -------------------------------------------------------------------------------- 1 | package com.author.examplemod.mixin.client; 2 | 3 | import com.author.examplemod.ModConstants; 4 | import net.minecraft.client.gui.screens.TitleScreen; 5 | import org.spongepowered.asm.mixin.Mixin; 6 | import org.spongepowered.asm.mixin.injection.At; 7 | import org.spongepowered.asm.mixin.injection.Inject; 8 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 9 | 10 | @Mixin(TitleScreen.class) 11 | public class ExampleForgeMixin { 12 | 13 | @Inject(at = @At("HEAD"), method = "init()V") 14 | private void init(CallbackInfo ci) { 15 | ModConstants.LOGGER.info("This line is printed by a mixin from Forge!"); 16 | } 17 | 18 | } -------------------------------------------------------------------------------- /NeoForge/src/main/java/com/author/examplemod/services/ForgePlatformHelper.java: -------------------------------------------------------------------------------- 1 | package com.author.examplemod.services; 2 | 3 | import com.author.examplemod.platform.IPlatformHelper; 4 | import net.neoforged.fml.ModList; 5 | import net.neoforged.fml.loading.FMLLoader; 6 | 7 | public class ForgePlatformHelper implements IPlatformHelper { 8 | 9 | @Override 10 | public String getPlatformName() { 11 | return "Forge"; 12 | } 13 | 14 | @Override 15 | public boolean isModLoaded(String modId) { 16 | return ModList.get().isLoaded(modId); 17 | } 18 | 19 | @Override 20 | public boolean isDevelopmentEnvironment() { 21 | return !FMLLoader.isProduction(); 22 | } 23 | } -------------------------------------------------------------------------------- /NeoForge/src/main/resources/META-INF/neoforge.mods.toml: -------------------------------------------------------------------------------- 1 | modLoader="javafml" 2 | loaderVersion="[1,)" 3 | license="MIT" 4 | issueTrackerURL="https://github.com/neoforged/" 5 | 6 | [[mods]] 7 | modId="${mod_id}" 8 | version="${version}" 9 | displayName="${mod_name}" 10 | #updateJSONURL="https://change.me.example.invalid/updates.json" 11 | displayURL="https://neoforged.net" 12 | logoFile="assets/examplemod/icon.png" 13 | credits="Thanks for this example mod goes to Java" 14 | authors="${mod_author}" 15 | description=''' 16 | This is a long form description of the mod. You can write whatever you want here 17 | 18 | Have some lorem ipsum. 19 | 20 | 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. 21 | ''' 22 | 23 | [[dependencies.${mod_id}]] 24 | modId="neoforge" 25 | type="required" 26 | versionRange="[21.0.0-beta,)" 27 | ordering="NONE" 28 | side="BOTH" 29 | 30 | [[dependencies.${mod_id}]] 31 | modId="minecraft" 32 | type="required" 33 | versionRange="[1.21,1.21.1)" 34 | ordering="NONE" 35 | side="BOTH" -------------------------------------------------------------------------------- /NeoForge/src/main/resources/META-INF/services/com.author.examplemod.platform.IPlatformHelper: -------------------------------------------------------------------------------- 1 | com.author.examplemod.services.ForgePlatformHelper -------------------------------------------------------------------------------- /NeoForge/src/main/resources/examplemod-neoforge.mixins.json: -------------------------------------------------------------------------------- 1 | { 2 | "required": true, 3 | "minVersion": "0.8", 4 | "package": "com.author.examplemod.mixin", 5 | "compatibilityLevel": "JAVA_17", 6 | "mixins": [ 7 | ], 8 | "client": [ 9 | "client.ExampleForgeMixin" 10 | ], 11 | "server": [ 12 | ], 13 | "injectors": { 14 | "defaultRequire": 1 15 | } 16 | } -------------------------------------------------------------------------------- /build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id 'java' 3 | id "xyz.wagyourtail.unimined" version "1.2.9" apply false 4 | } 5 | 6 | // Edit in gradle.properties 7 | group = project_group 8 | version = "${version_major}.${version_minor}.${version_patch}" 9 | 10 | subprojects { 11 | apply plugin: "xyz.wagyourtail.unimined" 12 | apply plugin: "java" 13 | apply plugin: 'maven-publish' 14 | 15 | group = rootProject.group 16 | version = rootProject.version 17 | 18 | sourceCompatibility = JavaVersion.VERSION_21 19 | targetCompatibility = JavaVersion.VERSION_21 20 | 21 | // Add your maven repositories here 22 | repositories { 23 | mavenCentral() 24 | 25 | // First Dark Dev Maven. Can be removed 26 | maven { 27 | url "https://maven.firstdark.dev/releases" 28 | } 29 | 30 | // First Dark Dev Mirror maven. Do not remove. 31 | // It's required by this project to pull in dependencies for the modloaders 32 | maven { 33 | url "https://mcentral.firstdark.dev/releases" 34 | } 35 | } 36 | 37 | dependencies { 38 | // Add global dependencies here 39 | // Dependencies added here will be applied to every module (Common/Fabric/Forge/NeoForge etc) 40 | } 41 | 42 | jar { 43 | manifest { 44 | attributes([ 45 | 'Specification-Title' : project.archivesBaseName, 46 | 'Specification-Vendor' : mod_author, 47 | 'Specification-Version' : project.version, 48 | 'Implementation-Title' : project.name, 49 | 'Implementation-Version' : project.version, 50 | 'Implementation-Vendor' : mod_author, 51 | 'Implementation-Timestamp': new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"), 52 | 'Timestamp' : System.currentTimeMillis(), 53 | 'Built-On-Java' : "${System.getProperty('java.vm.version')} (${System.getProperty('java.vm.vendor')})", 54 | 'Built-On-Minecraft' : minecraft_version 55 | ]) 56 | } 57 | } 58 | 59 | /** 60 | * =============================================================================== 61 | * = DO NOT EDIT BELOW THIS LINE UNLESS YOU KNOW WHAT YOU ARE DOING = 62 | * =============================================================================== 63 | */ 64 | 65 | unimined.minecraft(sourceSets.main, true) { 66 | version minecraft_version 67 | 68 | mappings { 69 | mojmap() 70 | devNamespace "mojmap" 71 | } 72 | } 73 | 74 | tasks.withType(JavaCompile).configureEach { 75 | it.options.encoding = 'UTF-8' 76 | it.options.release = 21 77 | } 78 | 79 | tasks.withType(GenerateModuleMetadata).configureEach { 80 | enabled = false 81 | } 82 | 83 | clean { 84 | delete "$rootDir/artifacts" 85 | } 86 | 87 | if (project.name !== 'Common') { 88 | tasks.register('delDevJar') { 89 | doLast { 90 | def tree = fileTree('build/libs') 91 | tree.include '**/*-dev-shadow.jar' 92 | tree.include '**/*-dev.jar' 93 | tree.include '**/*-all.jar' 94 | tree.include '**/*-slim.jar' 95 | tree.each { it.delete() } 96 | } 97 | } 98 | build.finalizedBy delDevJar 99 | 100 | tasks.register('copyAllArtifacts', Copy) { 101 | from "$buildDir/libs" 102 | into "$rootDir/artifacts" 103 | include("*.jar") 104 | } 105 | 106 | build.finalizedBy(copyAllArtifacts) 107 | } 108 | } 109 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | #Project 2 | version_major=1 3 | version_minor=0 4 | version_patch=0 5 | project_group=com.author.examplemod 6 | 7 | #Mod 8 | mod_author=ExampleModAuthor 9 | mod_id=examplemod 10 | mod_name=ExampleMod 11 | 12 | # Shared 13 | minecraft_version=1.21 14 | 15 | # Fabric 16 | fabric_loader=0.15.11 17 | fabric_api=0.102.0+1.21 18 | 19 | # NeoForge 20 | neoforge_version=167 21 | 22 | # Gradle Options 23 | org.gradle.jvmargs=-Xmx3G 24 | org.gradle.daemon=false -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firstdarkdev/fdd-xplat/03166c25dd36f587dee5ee341d84e475266a649c/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Sun Nov 05 19:31:04 SAST 2023 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip 5 | zipStoreBase=GRADLE_USER_HOME 6 | zipStorePath=wrapper/dists 7 | -------------------------------------------------------------------------------- /gradlew: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # 4 | # Copyright © 2015-2021 the original authors. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # https://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | ############################################################################## 20 | # 21 | # Gradle start up script for POSIX generated by Gradle. 22 | # 23 | # Important for running: 24 | # 25 | # (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is 26 | # noncompliant, but you have some other compliant shell such as ksh or 27 | # bash, then to run this script, type that shell name before the whole 28 | # command line, like: 29 | # 30 | # ksh Gradle 31 | # 32 | # Busybox and similar reduced shells will NOT work, because this script 33 | # requires all of these POSIX shell features: 34 | # * functions; 35 | # * expansions «$var», «${var}», «${var:-default}», «${var+SET}», 36 | # «${var#prefix}», «${var%suffix}», and «$( cmd )»; 37 | # * compound commands having a testable exit status, especially «case»; 38 | # * various built-in commands including «command», «set», and «ulimit». 39 | # 40 | # Important for patching: 41 | # 42 | # (2) This script targets any POSIX shell, so it avoids extensions provided 43 | # by Bash, Ksh, etc; in particular arrays are avoided. 44 | # 45 | # The "traditional" practice of packing multiple parameters into a 46 | # space-separated string is a well documented source of bugs and security 47 | # problems, so this is (mostly) avoided, by progressively accumulating 48 | # options in "$@", and eventually passing that to Java. 49 | # 50 | # Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, 51 | # and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; 52 | # see the in-line comments for details. 53 | # 54 | # There are tweaks for specific operating systems such as AIX, CygWin, 55 | # Darwin, MinGW, and NonStop. 56 | # 57 | # (3) This script is generated from the Groovy template 58 | # https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt 59 | # within the Gradle project. 60 | # 61 | # You can find Gradle at https://github.com/gradle/gradle/. 62 | # 63 | ############################################################################## 64 | 65 | # Attempt to set APP_HOME 66 | 67 | # Resolve links: $0 may be a link 68 | app_path=$0 69 | 70 | # Need this for daisy-chained symlinks. 71 | while 72 | APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path 73 | [ -h "$app_path" ] 74 | do 75 | ls=$( ls -ld "$app_path" ) 76 | link=${ls#*' -> '} 77 | case $link in #( 78 | /*) app_path=$link ;; #( 79 | *) app_path=$APP_HOME$link ;; 80 | esac 81 | done 82 | 83 | APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit 84 | 85 | APP_NAME="Gradle" 86 | APP_BASE_NAME=${0##*/} 87 | 88 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 89 | DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' 90 | 91 | # Use the maximum available, or set MAX_FD != -1 to use that value. 92 | MAX_FD=maximum 93 | 94 | warn () { 95 | echo "$*" 96 | } >&2 97 | 98 | die () { 99 | echo 100 | echo "$*" 101 | echo 102 | exit 1 103 | } >&2 104 | 105 | # OS specific support (must be 'true' or 'false'). 106 | cygwin=false 107 | msys=false 108 | darwin=false 109 | nonstop=false 110 | case "$( uname )" in #( 111 | CYGWIN* ) cygwin=true ;; #( 112 | Darwin* ) darwin=true ;; #( 113 | MSYS* | MINGW* ) msys=true ;; #( 114 | NONSTOP* ) nonstop=true ;; 115 | esac 116 | 117 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 118 | 119 | 120 | # Determine the Java command to use to start the JVM. 121 | if [ -n "$JAVA_HOME" ] ; then 122 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 123 | # IBM's JDK on AIX uses strange locations for the executables 124 | JAVACMD=$JAVA_HOME/jre/sh/java 125 | else 126 | JAVACMD=$JAVA_HOME/bin/java 127 | fi 128 | if [ ! -x "$JAVACMD" ] ; then 129 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 130 | 131 | Please set the JAVA_HOME variable in your environment to match the 132 | location of your Java installation." 133 | fi 134 | else 135 | JAVACMD=java 136 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 137 | 138 | Please set the JAVA_HOME variable in your environment to match the 139 | location of your Java installation." 140 | fi 141 | 142 | # Increase the maximum file descriptors if we can. 143 | if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then 144 | case $MAX_FD in #( 145 | max*) 146 | MAX_FD=$( ulimit -H -n ) || 147 | warn "Could not query maximum file descriptor limit" 148 | esac 149 | case $MAX_FD in #( 150 | '' | soft) :;; #( 151 | *) 152 | ulimit -n "$MAX_FD" || 153 | warn "Could not set maximum file descriptor limit to $MAX_FD" 154 | esac 155 | fi 156 | 157 | # Collect all arguments for the java command, stacking in reverse order: 158 | # * args from the command line 159 | # * the main class name 160 | # * -classpath 161 | # * -D...appname settings 162 | # * --module-path (only if needed) 163 | # * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. 164 | 165 | # For Cygwin or MSYS, switch paths to Windows format before running java 166 | if "$cygwin" || "$msys" ; then 167 | APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) 168 | CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) 169 | 170 | JAVACMD=$( cygpath --unix "$JAVACMD" ) 171 | 172 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 173 | for arg do 174 | if 175 | case $arg in #( 176 | -*) false ;; # don't mess with options #( 177 | /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath 178 | [ -e "$t" ] ;; #( 179 | *) false ;; 180 | esac 181 | then 182 | arg=$( cygpath --path --ignore --mixed "$arg" ) 183 | fi 184 | # Roll the args list around exactly as many times as the number of 185 | # args, so each arg winds up back in the position where it started, but 186 | # possibly modified. 187 | # 188 | # NB: a `for` loop captures its iteration list before it begins, so 189 | # changing the positional parameters here affects neither the number of 190 | # iterations, nor the values presented in `arg`. 191 | shift # remove old arg 192 | set -- "$@" "$arg" # push replacement arg 193 | done 194 | fi 195 | 196 | # Collect all arguments for the java command; 197 | # * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of 198 | # shell script including quotes and variable substitutions, so put them in 199 | # double quotes to make sure that they get re-expanded; and 200 | # * put everything else in single quotes, so that it's not re-expanded. 201 | 202 | set -- \ 203 | "-Dorg.gradle.appname=$APP_BASE_NAME" \ 204 | -classpath "$CLASSPATH" \ 205 | org.gradle.wrapper.GradleWrapperMain \ 206 | "$@" 207 | 208 | # Use "xargs" to parse quoted args. 209 | # 210 | # With -n1 it outputs one arg per line, with the quotes and backslashes removed. 211 | # 212 | # In Bash we could simply go: 213 | # 214 | # readarray ARGS < <( xargs -n1 <<<"$var" ) && 215 | # set -- "${ARGS[@]}" "$@" 216 | # 217 | # but POSIX shell has neither arrays nor command substitution, so instead we 218 | # post-process each arg (as a line of input to sed) to backslash-escape any 219 | # character that might be a shell metacharacter, then use eval to reverse 220 | # that process (while maintaining the separation between arguments), and wrap 221 | # the whole thing up as a single "set" statement. 222 | # 223 | # This will of course break if any of these variables contains a newline or 224 | # an unmatched quote. 225 | # 226 | 227 | eval "set -- $( 228 | printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | 229 | xargs -n1 | 230 | sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | 231 | tr '\n' ' ' 232 | )" '"$@"' 233 | 234 | exec "$JAVACMD" "$@" 235 | -------------------------------------------------------------------------------- /gradlew.bat: -------------------------------------------------------------------------------- 1 | @rem 2 | @rem Copyright 2015 the original author or authors. 3 | @rem 4 | @rem Licensed under the Apache License, Version 2.0 (the "License"); 5 | @rem you may not use this file except in compliance with the License. 6 | @rem You may obtain a copy of the License at 7 | @rem 8 | @rem https://www.apache.org/licenses/LICENSE-2.0 9 | @rem 10 | @rem Unless required by applicable law or agreed to in writing, software 11 | @rem distributed under the License is distributed on an "AS IS" BASIS, 12 | @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | @rem See the License for the specific language governing permissions and 14 | @rem limitations under the License. 15 | @rem 16 | 17 | @if "%DEBUG%" == "" @echo off 18 | @rem ########################################################################## 19 | @rem 20 | @rem Gradle startup script for Windows 21 | @rem 22 | @rem ########################################################################## 23 | 24 | @rem Set local scope for the variables with windows NT shell 25 | if "%OS%"=="Windows_NT" setlocal 26 | 27 | set DIRNAME=%~dp0 28 | if "%DIRNAME%" == "" set DIRNAME=. 29 | set APP_BASE_NAME=%~n0 30 | set APP_HOME=%DIRNAME% 31 | 32 | @rem Resolve any "." and ".." in APP_HOME to make it shorter. 33 | for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi 34 | 35 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 36 | set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" 37 | 38 | @rem Find java.exe 39 | if defined JAVA_HOME goto findJavaFromJavaHome 40 | 41 | set JAVA_EXE=java.exe 42 | %JAVA_EXE% -version >NUL 2>&1 43 | if "%ERRORLEVEL%" == "0" goto execute 44 | 45 | echo. 46 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 47 | echo. 48 | echo Please set the JAVA_HOME variable in your environment to match the 49 | echo location of your Java installation. 50 | 51 | goto fail 52 | 53 | :findJavaFromJavaHome 54 | set JAVA_HOME=%JAVA_HOME:"=% 55 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 56 | 57 | if exist "%JAVA_EXE%" goto execute 58 | 59 | echo. 60 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 61 | echo. 62 | echo Please set the JAVA_HOME variable in your environment to match the 63 | echo location of your Java installation. 64 | 65 | goto fail 66 | 67 | :execute 68 | @rem Setup the command line 69 | 70 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 71 | 72 | 73 | @rem Execute Gradle 74 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* 75 | 76 | :end 77 | @rem End local scope for the variables with windows NT shell 78 | if "%ERRORLEVEL%"=="0" goto mainEnd 79 | 80 | :fail 81 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 82 | rem the _cmd.exe /c_ return code! 83 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 84 | exit /b 1 85 | 86 | :mainEnd 87 | if "%OS%"=="Windows_NT" endlocal 88 | 89 | :omega 90 | -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | ## FDD-XPlat 2 | *** 3 | 4 | This project is a Gradle template that allows you to build Forge/Fabric mods using shared code. You do not require any extra libraries like Architectury. 5 | 6 | This project is powered by [Unimined](https://github.com/unimined/unimined), and supports almost every Minecraft version. 7 | 8 | *** 9 | 10 | ### Using this template 11 | 12 | *Before you start, please note that this project has been built on, and tested ONLY on IntelliJ idea. Other IDE's have not been tested, and cannot be guaranteed to work.* 13 | 14 | 1) Clone, download the project to your computer, or generate a new repository from this template 15 | 2) Open up `settings.gradle` and replace `rootProject.name = 'fdd-xplat'` with the name of your project 16 | 3) Open up `gradle.properties` and replace the following values: 17 | 1) `mod_author` -> Your name 18 | 2) `mod_id` -> The id of your mod. For example: `myawesomemod` 19 | 3) `mod_name` -> The name of your mod. This will be used for the output jars 20 | 4) `minecraft_version` -> The minecraft version your project targets 21 | 5) `fabric_loader` -> The fabric loader version to use. Find this [here](https://fabricmc.net/develop/) 22 | 6) `fabric_api` -> The Fabric API for your minecraft version. Find this [here](https://fabricmc.net/develop/) 23 | 7) `neoforge_version` -> The NeoForge version for your Minecraft version to use. For example: `39-beta` 24 | 25 | 4) Open up `fabric.mod.json` from the Fabric module, and replace the following values: 26 | 1) `description` -> Describe what your mod does 27 | 2) `homepage` -> Your Modrinth/Curseforge/GitHub page of the mod 28 | 3) `sources` -> Your GitHub repository of the mod 29 | 4) `license` -> Your mod license 30 | 5) `icon` -> Your mod icon 31 | 6) `minecraft` -> The minecraft version(s) your mod supports 32 | 7) If you do not plan on using mixins, remove the `mixins` section 33 | 34 | 5) Open up `mods.toml` from the NeoForge module and replace the following values: 35 | 1) `loaderVersion` -> The neoforge version code 36 | 2) `license` -> Your mod license 37 | 3) `issueTrackerURL` -> Your GitHub repository of the mod 38 | 6) `displayURL` -> Your Modrinth/Curseforge/GitHub page of the mod 39 | 7) `logoFile` -> Your mod icon 40 | 9) `description` -> Your mod description 41 | 11) `versionRange` -> `[neoforgeVersionCode,)` and `[1.20.2,)` (Replace with the minecraft versions your mod supports) 42 | 43 | 6) If your default JVM/JDK is not Java 21 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 JVM and changing the value to a valid Java 21 JVM. You will also need to set the Project SDK to Java 21. 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. 44 | 7) Replace the contents of `LICENSE` with your mod license 45 | 8) Replace the contents of `readme.md` with your mod readme 46 | 47 | *** 48 | 49 | ### Development Guide 50 | 51 | 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. 52 | 53 | 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. 54 | 55 | *** 56 | 57 | ### License 58 | 59 | This template is licensed under CC0-1.0 license. You can use your own license for the mods you make using this project -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | pluginManagement { 2 | repositories { 3 | mavenCentral() 4 | maven { 5 | url = "https://mcentral.firstdark.dev/releases" 6 | } 7 | gradlePluginPortal() { 8 | content { 9 | excludeGroup("org.apache.logging.log4j") 10 | } 11 | } 12 | } 13 | } 14 | 15 | rootProject.name = 'fdd-xplat' 16 | include('Common', 'Fabric', 'NeoForge') 17 | --------------------------------------------------------------------------------