CHANGSTAR: Audiophile Headphone Reviews and Early 90s Style BBS

Non-Audio Stuff => The Geek Cave: Home Theatre, Computers, and More! => Topic started by: takato14 on September 17, 2015, 05:58:40 AM

Title: I'm learning Java. For Minecraft modding shit. Yee.
Post by: takato14 on September 17, 2015, 05:58:40 AM
My friend is teaching me how to mod for Minecraft 1.7. I'm designing a replacement for BaracudaATA's Dragon Mounts mod, a mod which I make frequent use of and am constantly being annoyed by bugs, lack of content, etc etc. My aim is to fix up some of his code and add a lot more stuff to make the mod less cut-and-dry/barebones.

This thread is going to serve as my "homework". Every time we have a lesson I've been instructed to describe what I've learned in detail. Instead of leaving those text files to sit and waste away on my computer, I figured why not post it here instead?

This should be interesting and helpful for others interested in it.


Lesson 1: Setting up Git


Unfortunately this isn't the first time he's tried teaching me so my Forge dev environment has already been set up. There's plenty of tutorials for that anyways. So today we started with setting up a git repo. As usual, more went wrong than should have. Not sure why it was so finicky, but chances are other people will have the same problems I did, so here's the final process I ended up with:

**Please note, that this assumes you've ALREADY set forge up without setting up git first, or you're doing what I am and have to put someone else's code onto your repo before you start digging through it.


Woo hoo, git is set up. Fun. Now everyone can see and download your hard work and claim it as their own. Peachy.

Next stop: Forge mod structure.
Title: Re: I'm learning Java. For Minecraft modding shit. Yee.
Post by: Deep Funk on September 17, 2015, 07:35:28 AM
Karma for Java  ahoy
Title: Re: I'm learning Java. For Minecraft modding shit. Yee.
Post by: smitty1110 on September 17, 2015, 05:02:10 PM
Java has served me well, almost as well as perl and shell scripting. Good luck getting started with modding, last time I checked it was a mess.
Title: Re: I'm learning Java. For Minecraft modding shit. Yee.
Post by: IzzyAxel on September 18, 2015, 08:56:54 PM
Lesson 0/2, setting up Forge for 1.7.10 with IntelliJ IDEA: Install JDK 7/8/9, whatever you want to be using, add an environment variable with name IDEA_JDK and value of the path leading to your JDK installation's root folder. (not bin)  Install IntelliJ.  Download the Forge src, make a project folder, like "mods" anywhere you want, clone your repo (which should have a .gitignore and readme.md) into the root of the project folder.  Unzip the forge source into the cloned folder.  Open IntelliJ and import the build.gradle file included with the forge source, default import settings.

Click this thing:
(https://dl.dropboxusercontent.com/u/10036065/dnt/setup/button.png)
to bring up a sidebar on the right hand side.  There should be a Gradle section, click on that.  Run the 2 highlighted tasks (setupDecompWorkspace and genIntellijRuns):
(https://dl.dropboxusercontent.com/u/10036065/dnt/setup/tasks_sm.png) (https://dl.dropboxusercontent.com/u/10036065/dnt/setup/tasks.png)
Reload the project, and check in the left sidebar, under External Libraries; make sure you have the forgeSrc-1.7.10-(version numbers) folder, and inside it 'net' and 'minecraft'.  If you don't, I would suggest deleting everything and starting over, it sometimes doesn't decompile the source, but says it does, and the only way I've fixed it is to start from scratch. facepalm

Lastly, open the build.gradle file in a text editor, and paste this in at the very bottom:
Code: [Select]
idea {module {inheritOutputDirs = true}}