User Tools

Site Tools


tutorial:setup

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
tutorial:setup [2020/02/21 11:38] – Rearranging and add generator mkpolitutorial:setup [2020/04/20 20:15] – [Manual Steps] Add additional fix for Run Configurations not displaying 2xsaiko
Line 7: Line 7:
  
 ===== Mod Startup ===== ===== Mod Startup =====
 +There are two main ways to make a new mod for Minecraft based on Fabric. You can either manually download fabric-example-mod and setup by yourself, or use automatic tools for you.
 +
 ==== Manual Steps ==== ==== Manual Steps ====
    - Copy the starting files from [[https://github.com/FabricMC/fabric-example-mod/|fabric-example-mod]] (or from [[https://github.com/natanfudge/fabric-example-mod-kotlin|the Kotlin version]], if you wish to use Kotlin,) excluding the ''LICENSE'' and ''README.md'' files - as those apply to the template itself, not necessarily to your mod.    - Copy the starting files from [[https://github.com/FabricMC/fabric-example-mod/|fabric-example-mod]] (or from [[https://github.com/natanfudge/fabric-example-mod-kotlin|the Kotlin version]], if you wish to use Kotlin,) excluding the ''LICENSE'' and ''README.md'' files - as those apply to the template itself, not necessarily to your mod.
Line 21: Line 23:
 === IntelliJ IDEA === === IntelliJ IDEA ===
 If you are using IntelliJ IDEA by JetBrains, please follow these steps: If you are using IntelliJ IDEA by JetBrains, please follow these steps:
-    - Run ''gradlew idea'' first, then import the Project to IDEA+    - In the IDEA main menu, select 'Import Project(or File -> Open... if you already have a project open). 
-    - In order to run/debug your project, go to menu ''Run -> Edit Configurations...''In ''Run/Debug Configuration'' dialog, find ''Application Minecraft Client'' and change ''Use classpath of module'' form ''[ProjectName]'' to ''[ProjectName].main'', then change for ''Application > Minecraft Server'' as well. After pressing OKyou will know see Minecraft Client and Minecraft Server now showing up at Run/Debug Toolbar.+    - Select the project's build.gradle file to import the project. 
 +    - After Gradle is done setting up, close (File -> Close Project) and re-open the project to fix run configurations not displaying correctly
 +    - (If the run configurations still don't show up, try reimporting the Gradle project from the Gradle tab in IDEA.) 
 + 
 +//Optionalbut recommended//: 
 +By default, IntelliJ delegates to Gradle to build the projectThis is unnecessary for Fabric and causes longer build times and hotswapping related weirdness, among other problemsTo make it use the builtin compiler: 
 +    - Open the 'Gradle Settingsdialog from the Gradle tab. 
 +    - Change the 'Build and run using' and 'Run tests usingfields to 'IntelliJ IDEA'
 +    - Go to File -Project Structure -> Project and set 'Project compiler outputto the 'outsubdirectory of your project, if it isn't set yet. This directory doesn't have to exist, IDEA will create it when compiling the project for the first time(Tip: Use the 'Project Directorybutton in the directory select dialog to quickly jump to your project directory.) 
 + 
 +Unfortunatelyit is currently impossible to set an IDE-wide default for the 'Build and run usingand 'Run tests usingoptionsso these steps have to be repeated for every new project.
  
 === Eclipse === === Eclipse ===
Line 31: Line 43:
  
 ==== Generator ==== ==== Generator ====
-You many also use [[https://github.com/ExtraCrafTX/GeneratorFabricMod|GeneratorFabricMod]] by ExtraCrafTX, a convenient tool to automatically generate new fabric mods from template. Follow these steps:+You may also use [[https://github.com/ExtraCrafTX/GeneratorFabricMod|GeneratorFabricMod]] by ExtraCrafTX, a convenient tool to automatically generate new fabric mods from template. Follow these steps:
   - Download latest release of GeneratorFabricMod [[https://github.com/ExtraCrafTX/GeneratorFabricMod/releases|here]] and extract them.   - Download latest release of GeneratorFabricMod [[https://github.com/ExtraCrafTX/GeneratorFabricMod/releases|here]] and extract them.
   - Make a new directory, then run a command shell there and type ''path/to/GeneratorFabricMod/bin/GeneratorFabricMod''.   - Make a new directory, then run a command shell there and type ''path/to/GeneratorFabricMod/bin/GeneratorFabricMod''.
Line 37: Line 49:
   - You're now done, just open the project folder with in your IDE.   - You're now done, just open the project folder with in your IDE.
  
 +==== MinecraftDev IntelliJ IDEA Plugin ====
 +If you are using IntelliJ IDEA you can use Earthcomputer's experimental fork of the MinecraftDev plugin. This fork adds support for automatically generating Fabric projects as well as some mixin related features like inspections and generating accessors.
 +You can follow [[https://github.com/Earthcomputer/MinecraftDev/blob/dev_new/readme.md#installation|these instructions]] to install the plugin.
  
 ===== Getting started ===== ===== Getting started =====
Line 43: Line 58:
 ===== Advice ===== ===== Advice =====
   * While Fabric API is not strictly necessary for developing mods, its primary goal is to provide cross-compatibility and hooks where the game engine does not, and as such it is highly recommended!   * While Fabric API is not strictly necessary for developing mods, its primary goal is to provide cross-compatibility and hooks where the game engine does not, and as such it is highly recommended!
-  * As Fabric is in early development, occasionally, with development of fabric-loom (our Gradle build plugin) issues may crop up which require a manual clearing (deleting) of the cache (which can be found in ''.gradle/caches/fabric-loom''). Those will generally be announced as they are identified.+  * Occasionally, with development of fabric-loom (our Gradle build plugin) issues may crop up which require resetting the cache files. This can be done by running ''gradlew cleanloom''Running ''gradlew %%--%%stop'' can also help with a few rare issues.
   * Don't hesitate to ask questions! We're here to help you and work with you to make your dream mod a reality.   * Don't hesitate to ask questions! We're here to help you and work with you to make your dream mod a reality.
  
tutorial/setup.txt · Last modified: 2024/04/15 00:35 by solidblock