-
-
Notifications
You must be signed in to change notification settings - Fork 444
Fix getAssetsIndex task for FG1.0 #1075
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: FG_1.0
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| package net.minecraftforge.gradle; | ||
|
|
||
| import java.io.File; | ||
| import java.io.IOException; | ||
| import java.nio.charset.Charset; | ||
| import java.nio.charset.StandardCharsets; | ||
| import java.nio.file.Files; | ||
| import java.util.Objects; | ||
|
|
||
| public class FileUtils { | ||
| public static String readString(File file) throws IOException { | ||
| return readString(file, StandardCharsets.UTF_8); | ||
| } | ||
|
|
||
| public static String readString(File file, Charset charset) throws IOException { | ||
| return new String(Files.readAllBytes(file.toPath()), charset); | ||
| } | ||
|
|
||
| public static void updateDate(File file) throws IOException { | ||
| if (!file.createNewFile() && !file.setLastModified(System.currentTimeMillis())) { | ||
| throw new IOException("Unable to update modification time of " + file); | ||
| } | ||
| } | ||
|
|
||
| public static String getFileExtension(String fullName) { | ||
| Objects.requireNonNull(fullName); | ||
| String fileName = new File(fullName).getName(); | ||
| int dotIndex = fileName.lastIndexOf('.'); | ||
| return (dotIndex == -1) ? "" : fileName.substring(dotIndex + 1); | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -49,6 +49,9 @@ public String toString() | |
| public static final OperatingSystem OPERATING_SYSTEM = getOs(); | ||
| public static final SystemArch SYSTEM_ARCH = getArch(); | ||
|
|
||
| public static final String HASH_FUNC = "MD5"; | ||
| public static final String USER_AGENT = "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11"; | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do not run code formatters over existing code.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I formatted it on a whim, do I need to undo it?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, code changes should be actual changes not formatting. It makes it a pain to see what you actually changed. |
||
|
|
||
| // extension nam | ||
| public static final String EXT_NAME_MC = "minecraft"; | ||
| public static final String EXT_NAME_JENKINS = "jenkins"; | ||
|
|
@@ -60,12 +63,13 @@ public String toString() | |
| public static final Closure<Boolean> CALL_FALSE = new Closure<Boolean>(null){ public Boolean call(Object o){ return false; }}; | ||
|
|
||
| // urls | ||
| public static final String MC_JAR_URL = "http://s3.amazonaws.com/Minecraft.Download/versions/{MC_VERSION}/{MC_VERSION}.jar"; | ||
| public static final String MC_SERVER_URL = "http://s3.amazonaws.com/Minecraft.Download/versions/{MC_VERSION}/minecraft_server.{MC_VERSION}.jar"; | ||
| public static final String MCP_URL = "http://files.minecraftforge.net/fernflower_temporary.zip"; | ||
| public static final String ASSETS_URL = "http://resources.download.minecraft.net"; | ||
| public static final String MC_JAR_URL = "https://s3.amazonaws.com/Minecraft.Download/versions/{MC_VERSION}/{MC_VERSION}.jar"; | ||
| public static final String MC_SERVER_URL = "https://s3.amazonaws.com/Minecraft.Download/versions/{MC_VERSION}/minecraft_server.{MC_VERSION}.jar"; | ||
| public static final String MCP_URL = "https://files.minecraftforge.net/fernflower_temporary.zip"; | ||
| public static final String ASSETS_URL = "https://resources.download.minecraft.net"; | ||
| public static final String LIBRARY_URL = "https://libraries.minecraft.net/"; | ||
| public static final String ASSETS_INDEX_URL = "https://s3.amazonaws.com/Minecraft.Download/indexes/{ASSET_INDEX}.json"; | ||
| public static final String MC_JSON_INDEX_URL = "https://piston-meta.mojang.com/mc/game/version_manifest.json"; | ||
|
|
||
| public static final String LOG = ".gradle/gradle.log"; | ||
| public static final String ASSETS_INDEX = "legacy"; | ||
|
|
@@ -77,6 +81,9 @@ public String toString() | |
| public static final String FERNFLOWER = "{CACHE_DIR}/minecraft/fernflower.jar"; | ||
| public static final String EXCEPTOR = "{CACHE_DIR}/minecraft/exceptor.jar"; | ||
| public static final String ASSETS = "{CACHE_DIR}/minecraft/assets"; | ||
| public static final String JSONS_DIR = "{CACHE_DIR}/minecraft/versionJsons"; | ||
| public static final String VERSION_JSON_INDEX = JSONS_DIR + "/index.json"; | ||
| public static final String VERSION_JSON = JSONS_DIR + "/{MC_VERSION}.json"; | ||
|
|
||
| public static final String DEOBF_JAR = "{BUILD_DIR}/deobfuscated.jar"; | ||
| public static final String DEOBF_BIN_JAR = "{BUILD_DIR}/deobfuscated-bin.jar"; | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| package net.minecraftforge.gradle.json; | ||
|
|
||
| import java.util.Date; | ||
| import java.util.List; | ||
|
|
||
| // format of https://piston-meta.mojang.com/mc/game/version_manifest.json | ||
| public class MCVersionManifest { | ||
| public LatestInfo latest; | ||
| public List<Version> versions; | ||
|
|
||
| public Version findVersion(String versionId) { | ||
| for (Version v : versions) { | ||
| if (versionId.equals(v.id)) { | ||
| return v; | ||
| } | ||
| } | ||
| throw new IllegalArgumentException(versionId + " not found"); | ||
| } | ||
|
|
||
| public static class LatestInfo { | ||
| public String release; | ||
| public String snapshot; | ||
| } | ||
|
|
||
| public static class Version { | ||
| public String id; | ||
| public String type; | ||
| public String url; | ||
| public Date time; | ||
| public Date releaseTime; | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| package net.minecraftforge.gradle.json.version; | ||
|
|
||
|
|
||
| public class Downloads { | ||
| public DownloadFileInfo client; | ||
| public DownloadFileInfo server; | ||
| public DownloadFileInfo windows_server; | ||
|
|
||
| public static class DownloadFileInfo { | ||
| public String sha1; | ||
| public long size; | ||
| public String url; | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| package net.minecraftforge.gradle.json.version; | ||
|
|
||
| import net.minecraftforge.gradle.common.version.Version; | ||
|
|
||
| public interface VersionToString { | ||
| String apply(Version version); | ||
| } |
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
java.nio doesnt exist in java 6 Which is required to decompile the game correctly due to bugs in fernflower.
java.nio.file.Files was added in java 7
FG 1.2 works fine with this because it uses an updated Fernflower with stabilization
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm considering whether to upgrade compatibility to Java 7 or 8. Java 6 is practically obsolete.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are several other places that also mention the 1.7 API, but I don't know why they don't affect compilation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They dont effect compilation because youre using the system java to compile. Which is probably java 8+
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, there isnt even a distro for modern macs. Which is what im running into for mavenizer.
But its not possible to bump the required java version until the fernflower issues i stated are fixed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've tested it locally, and directly upgrading the version didn't reveal any bugs. I've even compiled and run the mod using my fixed FG. So I want to know what the problem is.