diff --git a/src/main/java/cam72cam/universalmodcore/Setup.java b/src/main/java/cam72cam/universalmodcore/Setup.java index f2cdbe4..feb7a10 100644 --- a/src/main/java/cam72cam/universalmodcore/Setup.java +++ b/src/main/java/cam72cam/universalmodcore/Setup.java @@ -23,7 +23,18 @@ public static void main(String[] args) throws IOException, GitAPIException { Files.readAllBytes(Paths.get("umc.json")) )) ).getAsJsonObject(); + + if (args.length == 0) { + System.err.println("No loader branch specified! Available branches can be found in the UniversalModCore GitHub repository."); + return; + } String loaderBranch = args[0]; + String[] split = loaderBranch.split("-"); + if (split.length < 2 || !split[0].matches("1\\.\\d*\\.\\d*") || !split[1].matches("[\\w-]+")) { + System.err.println("Invalid loader branch! It should be in the format '-'. For example, '1.12.2-forge'."); + return; + } + Config config = new Config(configObj, loaderBranch); ZipInputStream zip = new ZipInputStream(config.openJarStream());