Jump to content

GrygrFlzr

Members
  • Posts

    4
  • Joined

  • Last visited

Converted

  • Gender
    Undisclosed
  • Personal Text
    Developer of MCF Modlist

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

GrygrFlzr's Achievements

Tree Puncher

Tree Puncher (2/8)

34

Reputation

  1. Did anybody ever find oyut how to fix this? I've updated the thread to address [iurl=#troubleshoot]troubleshooting problems[/iurl].
  2. Update: Added [iurl=#update_forgegradle]a section on updating ForgeGradle.[/iurl]
  3. Are you sure of this? That seems quite absurd to me, seeing as this is the official way to build and use forge as of the latest builds. I'm quite sure they wouldn't release it if it where in such a useless state... The only mistake in that sentence (which luacs1998 has fixed) was saying deobfuscating instead of decompiling. At this point, ForgeGradle does not even decompile Minecraft, nor does it need to - you do not need access to Minecraft source code to run your mod.
  4. This tutorial assumes you have some previous knowledge of Minecraft modding and have gotten all the initial stuff done (PATH variables whatnot). Feel free to correct me. Check back once in a while for updates. Contents [iurl=#initial_setup]Initial Setup[/iurl] [iurl=#advanced_setup]Advanced Setup[/iurl] [iurl=#update_forge]Updating Forge[/iurl] [iurl=#update_forgegradle]Updating ForgeGradle[/iurl] [iurl=#compiling]Compiling/Obfuscating and Version Details[/iurl] [iurl=#migrationbeta]Migrating to 1.8[/iurl] [iurl=#migration]Migrating to 1.7[/iurl] [iurl=#update_forgegradle]Updating ForgeGradle[/iurl] [iurl=#troubleshoot]Troubleshooting Common Issues[/iurl] [ANCHOR=initial_setup]Initial Setup[/ANCHOR] First of all, make sure you have the latest version of Eclipse. Download the latest version of the Forge source from the usual place and extract it somewhere. Go inside the Forge folder. Windows: Use the cd command to navigate to the correct directory. You can also hold shift, right click and click Open command window here to open it in the current directory. Run the following in command prompt: gradlew.bat setupDecompWorkspace gradlew.bat eclipse Mac OS X: Use the cd command to navigate to the correct directory. Run the following in terminal: bash gradlew setupDecompWorkspace bash gradlew eclipse Linux: Use the cd command to navigate to the correct directory. Run the following in terminal: ./gradlew setupDecompWorkspace ./gradlew eclipse You may need to run the following beforehand if the gradlew file is not executable: chmod +x ./gradlew Replace eclipse with idea if you are using IntelliJ IDEA. If it is taking a long time to download assets, you can skip it by copying the assets folder from your normal minecraft folder to forge-directory/.gradle (so you will have forge-directory/.gradle/assets). Now open up Eclipse and point the project directory to the eclipse folder. If this doesn't work for you, skip to the advanced setup. You're done with the initial setup! You can now delete or study the example mod from src/main/java and the mcmod.info in src/main/resources. Replace it with your own mod. [ANCHOR=advanced_setup]Advanced Initial Setup[/ANCHOR] For those who cannot get the simple method to work. See [iurl=#troubleshoot]the troubleshooting section[/iurl] before trying this method. [ANCHOR=update_forge]Updating Forge[/ANCHOR] ForgeGradle allows you to update your dev environment to the latest version of Forge easily. Open your build.gradle file. The following lines will interest you for this part: minecraft { version = "1.7.2-10.12.2.1147" assetDir = "eclipse/assets" } Simply change the version field to the latest version of Forge, such as 1.7.10-10.13.0.1187. All versions are listed on the Forge download page. minecraft { version = "1.7.10-10.13.0.1187" assetDir = "eclipse/assets" } Save the file, then navigate to your Forge directory. Run the setup command from the initial setup (setupDecompWorkspace and eclipse). Forge will update the necessary files. If the process fails, you may also need to update ForgeGradle. [ANCHOR=update_forgegradle]Updating ForgeGradle[/ANCHOR] ForgeGradle is separate from Forge. Updating Forge alone will fail when updating between ForgeGradle versions. These are the current versions of ForgeGradle and the versions of Forge they cover: ForgeGradleForge Versions - 959<, 965 1.0 960-964 1.1 967-1047 1.2 1048+ Delete your .gradle folder. Then, open your build.gradle file. The following lines will interest you for this part: dependencies { classpath 'net.minecraftforge.gradle:ForgeGradle:1.1-SNAPSHOT' } Replace 1.1-SNAPSHOT with 1.2-SNAPSHOT. Afterwards, go to the bottom of the file - this part can also be done on any previous version of ForgeGradle processResources { // replace stuff in mcmod.info, nothing else from(sourceSets.main.resources.srcDirs) { ... Append 3 lines to the beginning of processResources: processResources { // this will ensure that this task is redone when the versions change. inputs.property "version", project.version inputs.property "mcversion", project.minecraft.version // replace stuff in mcmod.info, nothing else from(sourceSets.main.resources.srcDirs) { ... Save the file, then navigate to your Forge directory. Run the setup command from the initial setup (setupDecompWorkspace and eclipse). ForgeGradle will update the necessary files. [ANCHOR=compiling]Compiling/Obfuscating and Version Details[/ANCHOR] Open your build.gradle file. The following lines will interest you for this part: version = "1.0" group= "com.yourname.modid" // http://maven.apache.org/guides/mini/guide-naming-conventions.html archivesBaseName = "modid" Change the version field to the version of your mod. For usability purposes append the version of Minecraft as a prefix, such as 1.7.10- Change the group field to your personal project group names. For example, Forge uses net.minecraftforge Change the archivesBaseName field to your Mod ID, the same one as you put in your @Mod annotation. Your build.gradle file should look a bit like this now: version = "1.7.10-1.0" group= "com.github.username" // http://maven.apache.org/guides/mini/guide-naming-conventions.html archivesBaseName = "TestMod" Alternatively, you can append a suffix of the Minecraft version to your archivesBaseName field instead of the version field. Go inside the Forge folder and run the following in command prompt/terminal. Windows: gradlew.bat build Mac OS X: bash gradlew build Linux: ./gradlew build If this is not the first time you are building and ForgeGradle seems to ignore any changes you made to your build.gradle file, you need to run the following command beforehand. Backup your src folder first as it may be deleted. Windows: gradlew.bat clean Mac OS X: bash gradlew clean Linux: ./gradlew clean Your mod will be packaged as a .jar file inside forge-directory/build/libs - in our example, it will be named TestMod-1.7.2-1.0.jar For more complex setups requiring other mods as dependencies, visit the #ForgeGradle or #MinecraftForge channels on EsperNet. [ANCHOR=migrationbeta]Migration to 1.8 - Currently in beta![/ANCHOR] Here are some of the biggest changes for 1.8: Imports should change from [TT]cpw.mods[/TT] to [TT]net.minecraftforge[/TT]. For example: [TT]import cpw.mods.fml.common.Mod;[/TT] should be changed to [TT]import net.minecraftforge.fml.common.Mod;[/TT] New BlockState stuff currently in development, details coming Soon™. More to come as Forge for 1.8 is developed... [ANCHOR=migration]Migration from 1.6 to 1.7[/ANCHOR] Here are some of the biggest changes for 1.7: Mod metadata parsing has been overhauled and no longer supports the authors field. If you are still using it in your mcmod.info file, change it to authorList. Technically, authorList has been in FML since 1.5, but the wiki has not been updated to reflect this change. Goodbye block and item IDs! Those are now handled internally for you! Consequently, functions such as getBlockID no longer exist and have been replaced with a non-ID equivalent (in this case, getBlock). NetworkMod is gone. A more advanced networking library is available instead (Netty). @ForgeSubscribe is now @SubscribeEvent Interfaces are now events Renamed packets List of blocks are now in Blocks.class instead of Block.class List of items are now in Items.class instead of Item.class [ANCHOR=troubleshoot]Troubleshooting Common Issues[/ANCHOR] No Audio: Unable to play unknown soundEvent Add the following to your runtime arguments: Windows --assetIndex 1.7.10 --assetsDir %userprofile%\.gradle\caches\minecraft\assets If %userprofile% does not resolve to its actual value, you will need to use the absolute path. You can type it in Windows Explorer to resolve the directory. For example, mine would be [TT]C:\Users\GrygrFlzr\.gradle\caches\minecraft\assets[/TT] Linux/OS X --assetIndex 1.7.10 --assetsDir ~/.gradle/caches/minecraft/assets Crash: joptsimple.MissingRequiredOptionException: Missing required option(s) ['accessToken'] Add the following to your runtime arguments: --accessToken FML Crash: joptsimple.MissingRequiredOptionException: Missing required option(s) ['userProperties'] Add the following to your runtime arguments: --userProperties {} Crash: java.lang.UnsatisfiedLinkError: no lwjgl in java.library.path Right click the project (Minecraft) > Properties > Java Build Path > Libraries Scroll down to find your version of lwjgl (eg. [TT]lwjgl-2.9.1.jar[/TT]), click the arrow beside it, and double click Native Library Location. Locate your [TT]/build/natives[/TT] folder located in your workspace directory. For example, mine would be [TT]C:\Users\GrygrFlzr\Mods\GlowstoneWire\build\natives[/TT] You need to agree to the EULA in order to run the server. Go to eula.txt for more info. Follow what it says. Go to forge-directory/eclipse, open eula.txt and change [TT]false[/TT] to [TT]true[/TT]. If the file does not exist, just create one named eula.txt, and put the following in it: #By changing the setting below to TRUE you are indicating your agreement to our EULA (https://account.mojang.com/documents/minecraft_eula). eula=true [ANCHOR=credits]Thanks to:[/ANCHOR] LexManos for the new AbrarSyed for sort of explaining the process at 4AM when he should be sleeping, and giving pointers on ForgeGradle stuff luacs1998 for pointing out Run Configuration arguments for previous versions of ForgeGradle PaleoCrafter and SoniEx2 for mentioning authorList A whole bunch of other people I forgot to mention Visit the #ForgeGradle IRC channel on EsperNet for questions and discussion on ForgeGradle.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.