From 652808a132acdecdb28df5efaed9841833908e25 Mon Sep 17 00:00:00 2001 From: 0x7d8 Date: Thu, 12 Sep 2024 21:03:43 +0200 Subject: [PATCH] 1.20.1 support --- .github/FUNDING.yml | 2 ++ .../mcvapi/neoforgeserverjar/NeoForgeServerJAR.java | 13 ++++++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 .github/FUNDING.yml diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 0000000..77bb8fd --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1,2 @@ +github: ["mcjars", "0x7d8"] +ko_fi: "rjansen" diff --git a/src/main/java/dev/mcvapi/neoforgeserverjar/NeoForgeServerJAR.java b/src/main/java/dev/mcvapi/neoforgeserverjar/NeoForgeServerJAR.java index 25a60e5..3f5206c 100644 --- a/src/main/java/dev/mcvapi/neoforgeserverjar/NeoForgeServerJAR.java +++ b/src/main/java/dev/mcvapi/neoforgeserverjar/NeoForgeServerJAR.java @@ -8,7 +8,18 @@ public class NeoForgeServerJAR { public static void main(final String[] args) { - String directoryPath = "libraries/net/neoforged/neoforge"; + String directoryPath = null; + File neoforgeDir = new File("libraries/net/neoforged/neoforge"); + File forgeDir = new File("libraries/net/neoforged/forge"); + + if (neoforgeDir.exists() && neoforgeDir.isDirectory()) { + directoryPath = neoforgeDir.getPath(); + } else if (forgeDir.exists() && forgeDir.isDirectory()) { + directoryPath = forgeDir.getPath(); + } else { + ErrorReporter.error("10", true); + } + String forgeVersion = null; File directory = new File(directoryPath); File[] filesAndDirs = directory.listFiles();