You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if (!Strings.isNullOrEmpty(branch) && !"null".equals(branch))
242
-
this.forgeVersion += branch;
243
-
}
244
-
245
-
return;
246
-
}
247
-
248
-
thrownewGradleConfigurationException("Invalid version notation, or version doesnt exist! The following are valid notations. Buildnumber, version, version-branch, mcversion-version-branch, and pomotion");
103
+
intidx = str.indexOf('-');
104
+
if (idx == -1)
105
+
thrownewIllegalArgumentException("You must specify the full forge version, including MC version in your build.gradle. Example: 1.12.2-14.23.5.2811");
106
+
this.version = str.substring(0, idx); //MC Version
107
+
this.forgeVersion = str.substring(idx + 1);
108
+
109
+
/*
110
+
* Old FG used to use a horribly outdated MASSIVE json file for trying to be 'smart' when processing the version information.
111
+
* It tried to allow for many 'shortcuts' when specifying the Forge version.
112
+
* All of this are horribly and stupid, and should of never existed in the first place.
113
+
* So I'm gutting them.
114
+
*
115
+
* But will document them here to the best of my understanding, so that if people need them we can re-implement them in less horribly hacky ways.
116
+
*
117
+
* JUST the build number:
118
+
* Prior to 1.13, Forge used a unique build number to identify all versions. So in theory you could pick an exact build with just the build number.
119
+
* Example:
120
+
* Input: 2815
121
+
* Output: 1.12.2-14.23.5.2815
122
+
* Solution:
123
+
* Download maven-metadata.xml, loop through all versions doing:
124
+
* key = ver.split('-')[0].rsplit('.', 1)[1]
125
+
* if (!map.containsKey(key)) //This is important because metadata is ordered oldest to newest, and new versions could duplicate the build number
126
+
* map.put(key, ver)
127
+
*
128
+
*
129
+
* Promotion Name:
130
+
* We publish 'promoted' builds of Forge. Typically 'latest' and 'recommended'. Simple enough way to make a auto updating version.
131
+
* Example:
132
+
* Input: 1.8-recommended
133
+
* Output: 1.8-11.14.4.1563
134
+
* Solution:
135
+
* Again, Abrar downloaded a 2MB MASSIVE json file, when a slim json would do.
* Abrar tried to emulate dynamic versions which would be introduced into gradle far afterwords.
141
+
* Example:
142
+
* Input: 14.23.5.1
143
+
* Output: 1.12.2-14.23.5.2811
144
+
* Solution:
145
+
* Again, can be solved using maven-metadata.xml, use Apache's ArtifactVersion library to parse out a easy comparable version for everything in the metadata, and the version the user input.
thrownewGradleConfigurationException("This version of ForgeGradle ("+getExtension().forgeGradleVersion+") does not support forge builds less than #"+minBuild);
0 commit comments