Jump to content

Setting up Forge Gradle with separated workspace?


ianc1215

Recommended Posts

I am wanting to setup a Forge Gradle environment in what is best defined as the Pahimar style workspace.

 

In the old forge builds all you did was dive into the forge folder to find everything you needed. With the new system I am a little lost.

 

So where is all of the mcp files now?

 

I see the build folder has file I remember inside it but things seem to be all over the place compared to the old build system.

 

If someone has a bit of a road map I could follow I am sure I can figure it out. Can anyone give me a hand?

 

Also do I still need Gradle if I am using my own dev environment, I will be coding in straight java NOT gradle.

“Most good programmers do programming not because they expect to get paid or get adulation by the public, but because it is fun to program.” - Linus Torvalds

Link to comment
Share on other sites

Here's a little information on ForgeGradle that will help you understand:

 

Gradle is a program used to build java and other programs by compiling the source and building your jar. ForgeGradle is a plugin for this builder which also adds some new commands (known as tasks) to Gradle such as decompiling and deobfuscating Minecraft's jars and reobfuscating your mod to srg names required by ForgeModLoader and Forge.

 

Minecraft is no longer decompiled into a folder, as it was before ForgeGradle. Currently if you run the "setupDevWorkspace" command (otherwise called a gradle task) with ForgeGradle it will get the Minecraft jars, merge them together and swap all the obfuscated names (such as ab.class) to mcp names (such as EntityPlayer.class), which is known as deobfuscating. This will create the jar ~\.gradle\caches\minecraft\net\minecraftforge\forge\1.6.4-9.11.1.964\forge-1.6.4-9.11.1.964-mcp.jar (where ~ is your user folder). This jar should be referenced like the other library jars in your project, such as gson-2.2.2.jar and lwjgl-2.9.0.jar. With this setup you will unfortunately be unable to see what lies inside of each of Forge and Minecraft's many methods and classes.

 

This is where the gradle task "setupDecompWorkspace" comes in handy. It creates the same jar as "setupDevWorkspace" but also creates a forge-1.6.4-9.11.1.964-src.jar in the same folder, which once you set it as the forge-1.6.4-9.11.1.964-mcp.jar's source, you will be able to browse the code similarly as you would with the old setup, and see how the classes tick. Do note that this source jar is read only.  After your mod is completed you will need to run the gradle task "build". This is the same as the normal gradle build task however it translates the mcp names you have referenced in the forge-1.6.4-9.11.1.964-mcp.jar to srg names (names created by the mcp developers that stay the same between each minecraft version, where mojang's obfuscations do not). You can then find your built mod in the build/libs folder inside the folder containing your build.gradle file.

 

You will need the build.gradle file to remain in your project folder for the gradle tasks (commands) to take effect. If you don't have gradle installed on your computer, you will need the gradle wrapper in your project as well as you will need to send the build command to it.

 

I am wanting to setup a Forge Gradle environment in what is best defined as the Pahimar style workspace.

Chances are you are using eclipse, which I haven't  used in a while and will make this a little difficult. When I used eclipse I found that the "Pahimar workspace" aka "the normal workspace" was best used so there wasn't several mcp setups around your computer. As ForgeGradle stores most of it's files in the ~\.gradle directory setting up multiple build directories shouldn't take long or take up much space on your computer. As each mod will need it's own build.gradle file things become a little difficult. If you want the most hastle-free modding experience I can suggest opening up two eclipse windows and coding side-by-side. If you do want to use a "Pahimar workspace" you need to ask someone other than me. I may put together a tutorial on this at a later date.

 

So where is all of the mcp files now?

The ~/.gradle folder, see the the first four paragraphs.

 

I see the build folder has file I remember inside it but things seem to be all over the place compared to the old build system.

The only thing you need to worry about in the build folder is that when you run the "build" task in gradle, your compiled mod jar will be in there. The rest of the files in the build folder should be left alone.

 

Also do I still need Gradle if I am using my own dev environment, I will be coding in straight java NOT gradle.

You don't "code gradle", see the first paragraph.

Link to comment
Share on other sites

Wow absolutely fantastic! Thank you for the detailed explanation, this helps me out a lot.

 

Curiously if you are not using eclipse, then are you using? IntelliJ, Netbeans, etc.?

“Most good programmers do programming not because they expect to get paid or get adulation by the public, but because it is fun to program.” - Linus Torvalds

Link to comment
Share on other sites

IntelliJ IDEA, the free community edition. I got frustrated with it the first time I used it however I gave it a second chance and i'm never going back from it. This is mainly due to it giving suggestions as it predicts what you're typing (hard to explain) and the fact that it imports Gradle projects really well. All I do is click "Import project", select the build.gradle file and click next a couple of times. It sets up my src folder along with all of my dependencies leaving me ready to code around 20 seconds after the Gradle setup is complete. The only thing it doesn't do it set up the run configurations, but that's expected. I could go on for hours about how much I love it and all it's features (such as being a hell of a lot faster than eclipse and having themes!) but i'll leave it at this.

Link to comment
Share on other sites

Uh okay something is different for me.

 

The contents of my .gradle folder you are referring to is

 

1.8

  taskArtifacts

      cache.properties

      fileHashes.bin

      fileSnapshots.bin

      outFileStates.bin

      taskArtifacts.bin

 

 

There is no folder anywhere in the tree you mentioned.

 

If I look in the build folder which is only other place I see usable "built" files. There is a file in there called forge-1.6.4-9.11.1.964-srg.jar.

 

Its in a folder called decompile. I tried to reference it as a library to no avail. But there is a strong change I am doing something wrong.

“Most good programmers do programming not because they expect to get paid or get adulation by the public, but because it is fun to program.” - Linus Torvalds

Link to comment
Share on other sites

Yeah I have used IntelliJ before but I found the learning curve a little frustrating since I am sorta new to "real" programing (I say that very loosly) as in needing a dev environment. Scripting I can do but Java is a little new to me. hmm maybe I will give IntelliJ another shot.

 

Still.... see my post above.

“Most good programmers do programming not because they expect to get paid or get adulation by the public, but because it is fun to program.” - Linus Torvalds

Link to comment
Share on other sites

Uh okay something is different for me.

 

The contents of my .gradle folder you are referring to is

 

1.8

  taskArtifacts

      cache.properties

      fileHashes.bin

      fileSnapshots.bin

      outFileStates.bin

      taskArtifacts.bin

 

 

There is no folder anywhere in the tree you mentioned.

 

If I look in the build folder which is only other place I see usable "built" files. There is a file in there called forge-1.6.4-9.11.1.964-srg.jar.

 

Its in a folder called decompile. I tried to reference it as a library to no avail. But there is a strong change I am doing something wrong.

 

it would be the Gradle user home directory (default is USER_HOME/.gradle, which on a mac or linux would be ~/.gradle as HoBoS_TaCo mentioned) not the <project>/.gradle directory

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • If you're seeking an unparalleled solution to recover lost or stolen cryptocurrency, let me introduce you to GearHead Engineers Solutions. Their exceptional team of cybersecurity experts doesn't just restore your funds; they restore your peace of mind. With a blend of cutting-edge technology and unparalleled expertise, GearHead Engineers swiftly navigates the intricate web of the digital underworld to reclaim what's rightfully yours. In your moment of distress, they become your steadfast allies, guiding you through the intricate process of recovery with transparency, trustworthiness, and unwavering professionalism. Their team of seasoned web developers and cyber specialists possesses the acumen to dissect the most sophisticated schemes, leaving no stone unturned in their quest for justice. They don't just stop at recovering your assets; they go the extra mile to identify and track down the perpetrators, ensuring they face the consequences of their deceitful actions. What sets  GearHead Engineers apart is not just their technical prowess, but their unwavering commitment to their clients. From the moment you reach out to them, you're met with compassion, understanding, and a resolute determination to right the wrongs inflicted upon you. It's not just about reclaiming lost funds; it's about restoring faith in the digital landscape and empowering individuals to reclaim control over their financial futures. If you find yourself ensnared in the clutches of cybercrime, don't despair. Reach out to GearHead Engineers and let them weave their magic. With their expertise by your side, you can turn the tide against adversity and emerge stronger than ever before. In the realm of cybersecurity, GearHead Engineers reigns supreme. Don't just take my word for it—experience their unparalleled excellence for yourself. Your journey to recovery starts here.
    • Ok so this specific code freezes the game on world creation. This is what gets me so confused, i get that it might not be the best thing, but is it really so generation heavy?
    • Wizard web recovery has exhibited unparalleled strength in the realm of recovery. They stand out as the premier team to collaborate with if you encounter withdrawal difficulties from the platform where you’ve invested. Recently, I engaged with them to recover over a million dollars trapped in an investment platform I’d been involved with for months. I furnished their team with every detail of the investment, including accounts, names, and wallet addresses to which I sent the funds. This decision proved to be the best I’ve made, especially after realizing the company had scammed me.   Wizard web recovery ensures exemplary service delivery and ensures the perpetrators face justice. They employ advanced techniques to ensure you regain access to your funds. Understandably, many individuals who have fallen victim to investment scams may still regret engaging in online services again due to the trauma of being scammed. However, I implore you to take action. Seek assistance from Wizard Web Recovery today and witness their remarkable capabilities. I am grateful that I resisted their enticements, and despite the time it took me to discover Wizard web recovery, they ultimately fulfilled my primary objective. Without wizard web recovery intervention, I would have remained despondent and perplexed indefinitely.
    • I've tested the same code on three different envionrments (Desktop win10, desktop Linux and Laptop Linux) and it kinda blows up all the same. Gonna try this code and see if i can tune it
  • Topics

×
×
  • Create New...

Important Information

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