diff --git a/build.gradle b/build.gradle index 2af0eec..3592d3e 100644 --- a/build.gradle +++ b/build.gradle @@ -2,7 +2,7 @@ plugins { id 'com.gradle.plugin-publish' version '1.2.0' } -version = '2.8.2' +version = '2.8.3' group = 'com.modrinth.minotaur' archivesBaseName = 'Minotaur' description = 'Modrinth plugin for publishing builds to the website!' diff --git a/src/main/java/com/modrinth/minotaur/TaskModrinthUpload.java b/src/main/java/com/modrinth/minotaur/TaskModrinthUpload.java index d8925ab..ed279b4 100644 --- a/src/main/java/com/modrinth/minotaur/TaskModrinthUpload.java +++ b/src/main/java/com/modrinth/minotaur/TaskModrinthUpload.java @@ -106,6 +106,7 @@ public void apply() { if (ext.getLoaders().get().isEmpty() && ext.getDetectLoaders().get()) { Map pluginLoaderMap = new HashMap<>(); pluginLoaderMap.put("net.minecraftforge.gradle", "forge"); + pluginLoaderMap.put("net.neoforged.gradle", "neoforge"); pluginLoaderMap.put("org.quiltmc.loom", "quilt"); pluginLoaderMap.put("org.spongepowered.gradle.plugin", "sponge"); pluginLoaderMap.put("io.papermc.paperweight.userdev", "paper"); @@ -139,34 +140,32 @@ && getProject().getExtensions().findByName("loom") != null) { // Attempt to automatically resolve the game version if none were specified. if (ext.getGameVersions().get().isEmpty()) { - if (ext.getLoaders().get().contains("forge") && pluginManager.hasPlugin("net.minecraftforge.gradle")) { + if (pluginManager.hasPlugin("net.minecraftforge.gradle") || + pluginManager.hasPlugin("net.neoforged.gradle")) { // ForgeGradle will store the game version here. // https://github.com/MinecraftForge/ForgeGradle/blob/FG_5.0/src/userdev/java/net/minecraftforge/gradle/userdev/MinecraftUserRepo.java#L199 String version = (String) getProject().getExtensions().getExtraProperties().get("MC_VERSION"); if (version != null) { - getLogger().debug("Adding fallback game version {} from ForgeGradle.", version); + getLogger().debug("Adding fallback game version {} from ForgeGradle/NeoGradle.", version); add(ext.getGameVersions(), version); } } - if (ext.getLoaders().get().contains("fabric") || ext.getLoaders().get().contains("quilt") - || (ext.getLoaders().get().contains("forge") && !pluginManager.hasPlugin("net.minecraftforge.gradle"))) { - if (getProject().getExtensions().findByName("loom") != null) { - // Use the same method Loom uses to get the version. - // https://github.com/FabricMC/fabric-loom/blob/97f594da8e132c3d33cf39fe8d7cc0e76d84aeb6/src/main/java/net/fabricmc/loom/configuration/DependencyInfo.java#LL60C26-L60C56 - String version = getProject().getConfigurations().getByName("minecraft") - .getDependencies().iterator().next().getVersion(); + if (getProject().getExtensions().findByName("loom") != null) { + // Use the same method Loom uses to get the version. + // https://github.com/FabricMC/fabric-loom/blob/97f594da8e132c3d33cf39fe8d7cc0e76d84aeb6/src/main/java/net/fabricmc/loom/configuration/DependencyInfo.java#LL60C26-L60C56 + String version = getProject().getConfigurations().getByName("minecraft") + .getDependencies().iterator().next().getVersion(); - if (version != null) { - getLogger().debug("Adding fallback game version {} from Loom.", version); - add(ext.getGameVersions(), version); - } + if (version != null) { + getLogger().debug("Adding fallback game version {} from Loom.", version); + add(ext.getGameVersions(), version); } } - if (ext.getLoaders().get().contains("paper") && getProject().getExtensions().findByName("paperweight") != null) { - final String mcVer = getProject().getExtensions().getByType(PaperweightUserExtension.class).getMinecraftVersion().get(); + if (getProject().getExtensions().findByName("paperweight") != null) { + String mcVer = getProject().getExtensions().getByType(PaperweightUserExtension.class).getMinecraftVersion().get(); getLogger().debug("Adding fallback game version {} from paperweight-userdev.", mcVer); add(ext.getGameVersions(), mcVer); }