Jump to content

[BUG] Launch arguments are ignored, unable to run using Gradle


Two

Recommended Posts

I've been trying to setup Forge 1.7.2 Gradle with Netbeans without success so far. You can see the steps I've taken here.

 

The command I added:

-Pargs="--tweakClass cpw.mods.fml.common.launcher.FMLTweaker --version 1.6"

 

The main problem is, that even though I have correctly added the command-line parameters for the tweaker class (according to all sources on Gradle that I could find), Forge still uses the vanilla tweaker, and I cannot figure out why. And there is no error message (except for the vanilla error) that would help me on finding the issue.

It would be great if anyone could help me on this problem.

 

In addition I think it would be a good idea to add the correct tweaker class parameter to the setupdev task, because every dev will have to set that parameter otherwise by hand. So setting it by default might reduce the amount of 'Gradle doesn't work' topics. ;)

My Mods

 

New Dawn - A completely new terrain engine for Minecraft

TwoTility - Blocks and Items for a better Minecraft

TwoGraves - Keeps your items safe on death

Link to comment
Share on other sites

The only IDE we officially support is eclipse, and we ship the runtime configs for it.

Anyone who goes through another IDE does so at there own risk/volition.

Not sure why you're trying to go through gradle to start the game, your ide should be perfectly capabile of launching java with whatever arguments you give it...

I do Forge for free, however the servers to run it arn't free, so anything is appreciated.
Consider supporting the team on Patreon

Link to comment
Share on other sites

Not sure why you're trying to go through gradle to start the game, your ide should be perfectly capabile of launching java with whatever arguments you give it...

Because the Gradle-Plugin expects the game to be launched with a Gradle call. Which kind of makes sense, since otherwise I would have to break out of the entire Gradle-concept just to launch the application.

 

This as well renders the concept of an Eclipse support pointless, because Gradle is Gradle and independent from the IDE used if implemented correctly.

My Mods

 

New Dawn - A completely new terrain engine for Minecraft

TwoTility - Blocks and Items for a better Minecraft

TwoGraves - Keeps your items safe on death

Link to comment
Share on other sites

With your hint that the Forge build scripts actually do not define a proper run task, I tried to rule out all IDE problems by disabling the internal tasks and then writing my own run according to the official Gradle documentation:

apply plugin: 'java'

task(run, dependsOn: 'classes', type: JavaExec) {
  classpath = sourceSets.main.runtimeClasspath
  main = 'net.minecraft.launchwrapper.Launch'
  args '--version 1.6 --tweakClass cpw.mods.fml.common.launcher.FMLTweaker --accessToken FML'
  jvmArgs '-Xincgc -Xmx1G -Xms1G -Dfml.ignoreInvalidMinecraftCertificates=true'
}

 

And again the command-line parameters are ignored and the run fails, because Forge still uses the VanillaTweaker.

[14:40:06] [main/INFO]: Loading tweak class name net.minecraft.launchwrapper.VanillaTweaker
[14:40:06] [main/INFO]: Using primary tweak class name net.minecraft.launchwrapper.VanillaTweaker
[14:40:06] [main/INFO]: Calling tweak class net.minecraft.launchwrapper.VanillaTweaker
[14:40:06] [main/ERROR]: Unable to launch
java.lang.NoSuchMethodException: net.minecraft.client.Minecraft.main([Ljava.lang.String;)
at java.lang.Class.getMethod(Class.java:1665) ~[?:1.7.0_45]
at net.minecraft.launchwrapper.Launch.launch(Launch.java:131) [launchwrapper-1.9.jar:?]
at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.9.jar:?]

 

I would now consider this a bug.

My Mods

 

New Dawn - A completely new terrain engine for Minecraft

TwoTility - Blocks and Items for a better Minecraft

TwoGraves - Keeps your items safe on death

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.



×
×
  • Create New...

Important Information

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