Skip to content

Commit

Permalink
fix: Allow usage of MC 1.12 with NeoForge
Browse files Browse the repository at this point in the history
  • Loading branch information
Griefed committed Jun 18, 2024
1 parent ea18a9e commit 9b5db56
Showing 1 changed file with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -132,11 +132,12 @@ internal class NeoForgeLoader(

val newNeoDocument: Document = utilities.xmlUtilities.getXml(newNeoForgeManifest)
val newNeoElements = newNeoDocument.getElementsByTagName(version)
for (mcVersion in minecraftMeta.allVersionsDescending()) {
if (mcVersion.length < 6) {
val mcVersions = minecraftMeta.allVersionsDescending()
for (mcVersion in mcVersions) {
/*if (mcVersion.length < 6) { //Why did I do this in the first place? O.o
continue
}
val cutMinecraft = "^${mcVersion.substring(2)}.*".toRegex()
}*/
val mcVersionMinorPatch = "^${mcVersion.substring(2)}.*".toRegex()
val newNeoForgeVersionsForMCVer: MutableList<String> = ArrayList(100)

for (i in 0 until newNeoElements.length) {
Expand All @@ -145,7 +146,7 @@ internal class NeoForgeLoader(
val item = children.item(0)
val neoForgeVersion = item.nodeValue.toString()

if (neoForgeVersion.matches(cutMinecraft)) {
if (neoForgeVersion.matches(mcVersionMinorPatch)) {
if (!minecraftVersions.contains(mcVersion)) {
minecraftVersions.add(mcVersion)
}
Expand Down

0 comments on commit 9b5db56

Please sign in to comment.