MCDT - Minecraft Forge plugin for Eclipse

  • The FTB Forum is now read-only, and is here as an archive. To participate in our community discussions, please join our Discord! https://ftb.team/discord

immibis

New Member
Jul 29, 2019
884
0
0
Download: add http://immibis.com/mcdt/ as an update site to Eclipse, then install "MCDT - Basic Forge Plugin"¹. I developed this on Eclipse Luna, so you should probably have at least that version.


This adds a few things to Eclipse:

  • A "New Minecraft Forge mod project" wizard:
    hFoXV.png

    hFp1p.png

  • A convenient way to compile with Forge: (of course the wizard does this, but for existing projects you can add it via "Add Library..." on the Java Build Path settings page)
    hFt22.png

  • A convenient way to launch Forge mods. The wizard sets this up for you as well. (this is test data, so ignore that my ones are horribly named)

    hFt5F.png

  • And a convenient way to reobfuscate mods. Access this by right-clicking a project and selecting "Export...". This uses BON for obfuscation, not ForgeGradle, so report any problems to me.
    hFthE.png

    hFtjA.png

    hFtjZ.png

Note: If the selected Forge version hasn't already been set up in ForgeGradle, it will invoke ForgeGradle to decompile Minecraft for you, which takes a while (allow 5-15 minutes). This is the same as if you run it from the command line. At the moment, this blocks every other Eclipse job, so I suggest finding something else to do while you wait.

Also note: the first time you launch with a particular Forge version, the plugin will invoke ForgeGradle again to download native libraries. This is much faster and better-behaved, but still something to be aware of.


Report bugs and suggest features in this thread.






¹ MCDT was going to be a horrendously big and complicated thing, then I realized that 5% of the features would give you 50% of the usefulness, hence why this is the "basic" version.
 
Last edited:
C

chbachman

Guest
You have no idea how much I love you right now. <3

May I ask what the other 95% of the features are going to be in the full version?
 

immibis

New Member
Jul 29, 2019
884
0
0
You have no idea how much I love you right now. <3

May I ask what the other 95% of the features are going to be in the full version?
It was going to be a completely GUI-based mod maker thing, like Unity/GameMaker/etc but for mods. So generating as much code as possible for you, and hiding it behind something friendlier (lots of behind-the-scenes things were randomly generated, like language entry names).

But that's totally unnecessary for people who already know how to make mods, and a ton of work. So it's unlikely to happen, unless I have a lot of free time and nothing to do for some reason later.
 
Last edited:
  • Like
Reactions: xbony2 and RedBoss

downslope7

New Member
Jul 29, 2019
1
0
0
This looks absolutely amazing but I'm having a bit of difficulty getting it to work on OS X. I have no issues running gradlew setupDecompWorkspace on a minecraft forge mod from the command line but when I attempt to create a project using your plugin in eclipse I get this stack trace:

Code:
=== GRADLE setupDecompWorkspace FAILED ===
Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" java.lang.Error: java.io.FileNotFoundException: null/lib/tzdb.dat (No such file or directory)
	at sun.util.calendar.ZoneInfoFile$1.run(ZoneInfoFile.java:261)
	at java.security.AccessController.doPrivileged(Native Method)
	at sun.util.calendar.ZoneInfoFile.<clinit>(ZoneInfoFile.java:251)
	at sun.util.calendar.ZoneInfo.getTimeZone(ZoneInfo.java:589)
	at java.util.TimeZone.getTimeZone(TimeZone.java:560)
	at java.util.TimeZone.setDefaultZone(TimeZone.java:666)
	at java.util.TimeZone.getDefaultRef(TimeZone.java:636)
	at java.util.Date.<init>(Date.java:254)
	at java.util.zip.ZipUtils.dosToJavaTime(ZipUtils.java:74)
	at java.util.zip.ZipFile.getZipEntry(ZipFile.java:570)
	at java.util.zip.ZipFile.getEntry(ZipFile.java:313)
	at java.util.jar.JarFile.getEntry(JarFile.java:240)
	at java.util.jar.JarFile.getJarEntry(JarFile.java:223)
	at sun.misc.JarIndex.getJarIndex(JarIndex.java:134)
	at sun.misc.URLClassPath$JarLoader$1.run(URLClassPath.java:839)
	at sun.misc.URLClassPath$JarLoader$1.run(URLClassPath.java:831)
	at java.security.AccessController.doPrivileged(Native Method)
	at sun.misc.URLClassPath$JarLoader.ensureOpen(URLClassPath.java:830)
	at sun.misc.URLClassPath$JarLoader.<init>(URLClassPath.java:803)
	at sun.misc.URLClassPath$3.run(URLClassPath.java:530)
	at sun.misc.URLClassPath$3.run(URLClassPath.java:520)
	at java.security.AccessController.doPrivileged(Native Method)
	at sun.misc.URLClassPath.getLoader(URLClassPath.java:519)
	at sun.misc.URLClassPath.getLoader(URLClassPath.java:492)
	at sun.misc.URLClassPath.getNextLoader(URLClassPath.java:457)
	at sun.misc.URLClassPath.getResource(URLClassPath.java:211)
	at java.net.URLClassLoader$1.run(URLClassLoader.java:365)
	at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:411)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:495)
Caused by: java.io.FileNotFoundException: null/lib/tzdb.dat (No such file or directory)
	at java.io.FileInputStream.open0(Native Method)
	at java.io.FileInputStream.open(FileInputStream.java:195)
	at java.io.FileInputStream.<init>(FileInputStream.java:138)
	at sun.util.calendar.ZoneInfoFile$1.run(ZoneInfoFile.java:255)
	... 34 more

I'm running the jdk1.8.0_45 and Eclipse Luna SR2 4.4.2.
 

immibis

New Member
Jul 29, 2019
884
0
0
This looks absolutely amazing but I'm having a bit of difficulty getting it to work on OS X. I have no issues running gradlew setupDecompWorkspace on a minecraft forge mod from the command line but when I attempt to create a project using your plugin in eclipse I get this stack trace:

Code:
=== GRADLE setupDecompWorkspace FAILED ===
Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" java.lang.Error: java.io.FileNotFoundException: null/lib/tzdb.dat (No such file or directory)
    at sun.util.calendar.ZoneInfoFile$1.run(ZoneInfoFile.java:261)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.util.calendar.ZoneInfoFile.<clinit>(ZoneInfoFile.java:251)
    at sun.util.calendar.ZoneInfo.getTimeZone(ZoneInfo.java:589)
    at java.util.TimeZone.getTimeZone(TimeZone.java:560)
    at java.util.TimeZone.setDefaultZone(TimeZone.java:666)
    at java.util.TimeZone.getDefaultRef(TimeZone.java:636)
    at java.util.Date.<init>(Date.java:254)
    at java.util.zip.ZipUtils.dosToJavaTime(ZipUtils.java:74)
    at java.util.zip.ZipFile.getZipEntry(ZipFile.java:570)
    at java.util.zip.ZipFile.getEntry(ZipFile.java:313)
    at java.util.jar.JarFile.getEntry(JarFile.java:240)
    at java.util.jar.JarFile.getJarEntry(JarFile.java:223)
    at sun.misc.JarIndex.getJarIndex(JarIndex.java:134)
    at sun.misc.URLClassPath$JarLoader$1.run(URLClassPath.java:839)
    at sun.misc.URLClassPath$JarLoader$1.run(URLClassPath.java:831)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.misc.URLClassPath$JarLoader.ensureOpen(URLClassPath.java:830)
    at sun.misc.URLClassPath$JarLoader.<init>(URLClassPath.java:803)
    at sun.misc.URLClassPath$3.run(URLClassPath.java:530)
    at sun.misc.URLClassPath$3.run(URLClassPath.java:520)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.misc.URLClassPath.getLoader(URLClassPath.java:519)
    at sun.misc.URLClassPath.getLoader(URLClassPath.java:492)
    at sun.misc.URLClassPath.getNextLoader(URLClassPath.java:457)
    at sun.misc.URLClassPath.getResource(URLClassPath.java:211)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:365)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:411)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:495)
Caused by: java.io.FileNotFoundException: null/lib/tzdb.dat (No such file or directory)
    at java.io.FileInputStream.open0(Native Method)
    at java.io.FileInputStream.open(FileInputStream.java:195)
    at java.io.FileInputStream.<init>(FileInputStream.java:138)
    at sun.util.calendar.ZoneInfoFile$1.run(ZoneInfoFile.java:255)
    ... 34 more

I'm running the jdk1.8.0_45 and Eclipse Luna SR2 4.4.2.

Can you try this as a workaround and report back? Evidently, starting Java works differently on OSX than from Windows, and MCDT is trying to do it the wrong way.
 
C

chbachman

Guest
Can you try this as a workaround and report back? Evidently, starting Java works differently on OSX than from Windows, and MCDT is trying to do it the wrong way.
I had the same problem, tried the workaround, and failed. The stacktrace is the same, and just to show I tried the workaround:

Code:
chbachman-MacBook-Pro:~ chbachman$ printenv

JAVA_HOME=/usr/libexec/java_home -v 1.7

_=/usr/bin/printenv
 

immibis

New Member
Jul 29, 2019
884
0
0
I had the same problem, tried the workaround, and failed. The stacktrace is the same, and just to show I tried the workaround:

Code:
chbachman-MacBook-Pro:~ chbachman$ printenv

JAVA_HOME=/usr/libexec/java_home -v 1.7

_=/usr/bin/printenv

Try updating. Now it should look at your "Installed JREs" settings (in Eclipse) to figure out how to run Gradle. (I don't have a Mac to test on)

If you don't have JDK 7 or 8 set up in Eclipse (since Eclipse oddly enough doesn't require a JDK, but Gradle does), you'll get an error. In that case, go to Window->Preferences->Java->Installed JREs and add the JDK.
 
  • Like
Reactions: chbachman

xbony2

WikiWorker
Wiki Staff
FTB Mod Dev
Jul 3, 2013
914
1,353
201
America
ftb.gamepedia.com
Kind of a late reply, sorry :3 this is great.

Can you make it so .lang files on default open as a Properties File? That's what they are, as far as I know.
 

immibis

New Member
Jul 29, 2019
884
0
0
Small update: There's now a checkbox, in the options of a Forge launch configuration, to reobfuscate before running. This is extremely useful for testing with other mods. It's surprisingly fast, too.

Note: it reobfuscates to SRG, not fully, so a very small number of mods that don't use SRG names won't load.

Also note: it breaks the debugger a bit, since method/field names don't match between the source code and what's actually running.
 

RulerjdogYT

New Member
Jul 29, 2019
1
0
0
Having Issues installing the main package. None of the other versions work either. Using Eclipse Luna x64 on Windows 8.1 (It's bad, I know.)

An error occurred while collecting items to be installed
session context was:(profile=epp.package.jee, phase=org.eclipse.equinox.internal.p2.engine.phases.Collect, operand=, action=).
Problems downloading artifact: osgi.bundle,20E842C0-E101-35FD-A39C-E059B1BC43D4,1.2.7.
Error reading signed content:C:\Users\Jameson\AppData\Local\Temp\signatureFile8962909674311030321.jar
An error occurred while processing the signatures for the file: C:\Users\Jameson\AppData\Local\Temp\signatureFile8962909674311030321.jar
Problems downloading artifact: org.eclipse.update.feature,com.immibis.mcdt.basic_forge_feature,1.0.4.
Error reading signed content:C:\Users\Jameson\AppData\Local\Temp\signatureFile3903279790628006067.jar
An error occurred while processing the signatures for the file: C:\Users\Jameson\AppData\Local\Temp\signatureFile3903279790628006067.jar