So one time, I tried to set up the mod development workspace for Minecraft Forge 1.10.2. As usual, I ran gradlew setupDecompWorkspace eclipse
. At getAssets
task, however, the console fills up with errors:
java.io.IOException: Server returned HTTP response code: 400 for URL: http://resources.download.minecraft.net/...
It turns out that the problem occurs when the following conditions are met:
.minecraft
directory somewhere other than the default location (this was my case).When getting the assets, ForgeGradle with first lookup your local .minecraft
directory for them (at the default location), which fails under condition 2. Then, it falls back to downloading it from Minecraft's servers.
In ForgeGradle 2.3 and before, it tries to grab them from the following URL as defined here:
public static final String URL_ASSETS = "http://resources.download.minecraft.net";
However, the API seems to have been recently changed so it only accepts HTTPS connections. The requests are rejected because the URL specifies http
protocol.
So, if you want to work with Forge on an old Minecraft version, what can you do?
You can fix it by making condition 2 not hold, therefore, the goal are to
.minecraft
location.Make sure that you launched the Minecraft version at least once so that the assets are downloaded.
This applies to people who moved their .minecraft
directory from the default locations, which is inside the directory pointed by APPDATA
environment variable on Windows and the user's home directory on Linux/OSX.
You can therefore fix it by (temporarily) setting APPDATA
(Windows) or user.home
(Linux/OSX) environment variable to the parent directory of your .minecraft
directory. Look up how to do it on your OS and shell. Since I was on Windows and Powershell, I ran the following:
$env:APPDATA="Z:\path\to\parent"
This causes ForgeGradle to match Z:\path\to\parent\.minecraft
. If it finds that you have locally-downloaded assets for the version, it can take them from there.
Finally, run the command gradlew setupDecompWorkspace eclipse
once again. No HTTP errors now, because it no longer gets them from remote.