Skip to content

Commit

Permalink
Update neoforge jar path to remove the MC version prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
Technici4n committed Nov 9, 2023
1 parent 1a7537c commit b9e9c9e
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@ public record VersionInfo(String neoForgeVersion, String fmlVersion, String mcVe
this((String) arguments.get("neoForgeVersion"), (String) arguments.get("fmlVersion"), (String) arguments.get("mcVersion"), (String) arguments.get("neoFormVersion"));
}

public String mcAndNeoForgeVersion() {
return mcVersion + "-"+ neoForgeVersion;
}
public String mcAndFmlVersion() {
return mcVersion+"-"+ fmlVersion;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

package net.neoforged.fml.loading.targets;

import cpw.mods.modlauncher.api.ILaunchHandlerService;
import net.neoforged.fml.loading.LibraryFinder;
import net.neoforged.fml.loading.VersionInfo;

Expand All @@ -14,7 +13,7 @@
import java.util.function.BiPredicate;
import java.util.stream.Stream;

public class FMLServerLaunchHandler extends CommonServerLaunchHandler implements ILaunchHandlerService {
public class FMLServerLaunchHandler extends CommonServerLaunchHandler {
@Override public String name() { return "fmlserver"; }

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ public class ForgeClientLaunchHandler extends CommonClientLaunchHandler {

@Override
protected void processMCStream(VersionInfo versionInfo, Stream.Builder<Path> mc, Stream.Builder<List<Path>> mods) {
var forgepatches = LibraryFinder.findPathForMaven("net.neoforged", "neoforge", "", "client", versionInfo.mcAndNeoForgeVersion());
var forgejar = LibraryFinder.findPathForMaven("net.neoforged", "neoforge", "", "universal", versionInfo.mcAndNeoForgeVersion());
var forgepatches = LibraryFinder.findPathForMaven("net.neoforged", "neoforge", "", "client", versionInfo.neoForgeVersion());
var forgejar = LibraryFinder.findPathForMaven("net.neoforged", "neoforge", "", "universal", versionInfo.neoForgeVersion());
mc.add(forgepatches);
mods.add(List.of(forgejar));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

package net.neoforged.fml.loading.targets;

import cpw.mods.modlauncher.api.ILaunchHandlerService;
import net.neoforged.fml.loading.LibraryFinder;
import net.neoforged.fml.loading.VersionInfo;

Expand All @@ -14,13 +13,13 @@
import java.util.function.BiPredicate;
import java.util.stream.Stream;

public class ForgeServerLaunchHandler extends CommonServerLaunchHandler implements ILaunchHandlerService {
public class ForgeServerLaunchHandler extends CommonServerLaunchHandler {
@Override public String name() { return "forgeserver"; }

@Override
protected BiPredicate<String, String> processMCStream(VersionInfo versionInfo, Stream.Builder<Path> mc, BiPredicate<String, String> filter, Stream.Builder<List<Path>> mods) {
var forgepatches = LibraryFinder.findPathForMaven("net.neoforged", "neoforge", "", "server", versionInfo.mcAndNeoForgeVersion());
var forgejar = LibraryFinder.findPathForMaven("net.neoforged", "neoforge", "", "universal", versionInfo.mcAndNeoForgeVersion());
var forgepatches = LibraryFinder.findPathForMaven("net.neoforged", "neoforge", "", "server", versionInfo.neoForgeVersion());
var forgejar = LibraryFinder.findPathForMaven("net.neoforged", "neoforge", "", "universal", versionInfo.neoForgeVersion());
mc.add(forgepatches);
mods.add(List.of(forgejar));
return filter;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,9 @@
public abstract class ForgeUserdevLaunchHandler extends CommonUserdevLaunchHandler {
@Override
protected void processStreams(String[] classpath, VersionInfo versionInfo, Stream.Builder<Path> mc, Stream.Builder<List<Path>> mods) {
var forge = searchJarOnClasspath(classpath, "neoforge-" + versionInfo.mcAndNeoForgeVersion());
var forge = searchJarOnClasspath(classpath, "neoforge-" + versionInfo.neoForgeVersion());
if (forge.isEmpty()) {
forge = searchJarOnClasspath(classpath, "neoforge-" + versionInfo.neoForgeVersion());
}
if (forge.isEmpty()) {
throw new RuntimeException("Could not find %s, nor %s jar on classpath".formatted("neoforge-" + versionInfo.mcAndNeoForgeVersion(), "neoforge-" + versionInfo.neoForgeVersion()));
throw new RuntimeException("Could not find %s, nor %s jar on classpath".formatted("neoforge-" + versionInfo.neoForgeVersion(), "neoforge-" + versionInfo.neoForgeVersion()));
}
mc.add(forge.get());
}
Expand Down

0 comments on commit b9e9c9e

Please sign in to comment.