From eb4ee1bf3cc1d13ff0a22a5913927bbc90bf65e2 Mon Sep 17 00:00:00 2001 From: Des Herriott Date: Mon, 1 Jul 2024 16:08:56 +0100 Subject: [PATCH 1/3] build: tidied up build.gradle publishing --- build.gradle | 47 ++++++++++++++++++++--------------------------- 1 file changed, 20 insertions(+), 27 deletions(-) diff --git a/build.gradle b/build.gradle index 3f4d5b9..b2fe0c0 100644 --- a/build.gradle +++ b/build.gradle @@ -84,24 +84,27 @@ subprojects { } } - -// TODO: Move this to a common location? -Closure releaseTypeToPublishType = { type -> - switch(type) { - case "release": return ReleaseType.STABLE - case "beta": return ReleaseType.BETA - case "alpha": return ReleaseType.ALPHA - default: return ReleaseType.STABLE - } -} - publishMods { dryRun = providers.environmentVariable("CURSEFORGE_KEY").getOrNull() == null changelog = providers.environmentVariable("CHANGELOG").orElse("") version = mod_version - type = releaseTypeToPublishType(ftbPublishing.relType) - def curseOptions = curseforgeOptions { + def tag = providers.environmentVariable("TAG").getOrElse("release") + type = tag.endsWith("-beta") ? BETA : (tag.endsWith("-alpha") ? ALPHA : STABLE) + + def createOptions = (String projectName) -> { + publishOptions { + file = project.provider { project(":$projectName").tasks.remapJar }.flatMap { it.archiveFile } + displayName = "[${projectName.toUpperCase()}][${minecraft_version}] ${readable_name} ${mod_version}" + modLoaders.add(projectName.toLowerCase()) + } + } + + def fabricOptions = createOptions("fabric") + def neoForgeOptions = createOptions("neoforge") +// def forgeOptions = createOptions("forge") + + def curseForgeOptions = curseforgeOptions { accessToken = providers.environmentVariable("CURSEFORGE_KEY") projectId = project.curseforge_id minecraftVersions.add(rootProject.minecraft_version) @@ -112,31 +115,21 @@ publishMods { } // curseforge("forge") { -// from curseOptions -// modLoaders.add("forge") -// file = project(":forge").tasks.remapJar.archiveFile -// displayName = "[FORGE] FTB Filter System ${mod_version} MC ${minecraft_version}" +// from (curseForgeOptions, forgeOptions) // } curseforge("neoforge") { - from curseOptions - modLoaders.add("neoforge") - file = project(":neoforge").tasks.remapJar.archiveFile - displayName = "[NEOFORGE] FTB Filter System ${mod_version} MC ${minecraft_version}" + from (curseForgeOptions, neoForgeOptions) } curseforge("fabric") { - from curseOptions - modLoaders.add("fabric") - file = project(":fabric").tasks.remapJar.archiveFile - displayName = "[FABRIC] FTB Filter System ${mod_version} MC ${minecraft_version}" - + from (curseForgeOptions, fabricOptions) requires { slug = "fabric-api" } } - // TODO uncomment this one day but will need to redo how our publishing workflow happens + // TODO uncomment this one day but we need to redo how our publishing workflow happens // github { // repository = "ftbteam/ftb-filter-system" // accessToken = providers.environmentVariable("GITHUB_TOKEN") From 844513cfba47d49b96bc4c8dbc1683613a34e8d1 Mon Sep 17 00:00:00 2001 From: Des Herriott Date: Fri, 26 Jul 2024 09:43:12 +0100 Subject: [PATCH 2/3] chore: restore JEI support, update some deps JEI >=19.5.0.40 needed --- build.gradle | 2 +- common/build.gradle | 1 + .../client/gui/ComponentConfigScreen.java | 1 - .../integration/jei/FFSScreenHandler.java | 14 ++-- .../integration/jei/JEIIntegration.java | 65 +++++++++---------- fabric/src/main/resources/fabric.mod.json | 3 + gradle.properties | 9 ++- gradle/wrapper/gradle-wrapper.properties | 2 +- neoforge/build.gradle | 1 + .../resources/META-INF/neoforge.mods.toml | 7 ++ 10 files changed, 57 insertions(+), 48 deletions(-) diff --git a/build.gradle b/build.gradle index b2fe0c0..efce268 100644 --- a/build.gradle +++ b/build.gradle @@ -2,7 +2,7 @@ import me.modmuss50.mpp.ReleaseType plugins { id "architectury-plugin" version "3.4-SNAPSHOT" - id "dev.architectury.loom" version "1.6-SNAPSHOT" apply false + id "dev.architectury.loom" version "1.7-SNAPSHOT" apply false id "me.modmuss50.mod-publish-plugin" version "0.5.1" } diff --git a/common/build.gradle b/common/build.gradle index a3898b9..b42dbc1 100644 --- a/common/build.gradle +++ b/common/build.gradle @@ -14,6 +14,7 @@ dependencies { modApi "dev.architectury:architectury:${rootProject.architectury_version}" modCompileOnly("mezz.jei:jei-${rootProject.minecraft_version}-common-api:${rootProject.jei_version}") + modRuntimeOnly("mezz.jei:jei-${rootProject.minecraft_version}-common:${rootProject.jei_version}") } tasks.register("buildApi", Jar) { diff --git a/common/src/main/java/dev/ftb/mods/ftbfiltersystem/client/gui/ComponentConfigScreen.java b/common/src/main/java/dev/ftb/mods/ftbfiltersystem/client/gui/ComponentConfigScreen.java index 5fb464d..0895bfc 100644 --- a/common/src/main/java/dev/ftb/mods/ftbfiltersystem/client/gui/ComponentConfigScreen.java +++ b/common/src/main/java/dev/ftb/mods/ftbfiltersystem/client/gui/ComponentConfigScreen.java @@ -82,7 +82,6 @@ public Rect2i getGhostDropRegion() { return new Rect2i(editBox.getX(), editBox.getY(), editBox.getWidth(), editBox.getHeight()); } - @SuppressWarnings("UnreachableCode") @Override public void receiveGhostDrop(ItemStack stack) { if (PlatformUtil.hasComponentPatch(stack)) { diff --git a/common/src/main/java/dev/ftb/mods/ftbfiltersystem/integration/jei/FFSScreenHandler.java b/common/src/main/java/dev/ftb/mods/ftbfiltersystem/integration/jei/FFSScreenHandler.java index 6b0a335..ce589f3 100644 --- a/common/src/main/java/dev/ftb/mods/ftbfiltersystem/integration/jei/FFSScreenHandler.java +++ b/common/src/main/java/dev/ftb/mods/ftbfiltersystem/integration/jei/FFSScreenHandler.java @@ -14,37 +14,37 @@ class FFSScreenHandler> implements IScre private record GuiProps(AbstractFilterConfigScreen guiScreen) implements IGuiProperties { @Override - public Class getScreenClass() { + public Class screenClass() { return guiScreen.getClass(); } @Override - public int getGuiLeft() { + public int guiLeft() { return guiScreen.getGuiBounds().getX(); } @Override - public int getGuiTop() { + public int guiTop() { return guiScreen.getGuiBounds().getY(); } @Override - public int getGuiXSize() { + public int guiXSize() { return guiScreen.getGuiBounds().getWidth(); } @Override - public int getGuiYSize() { + public int guiYSize() { return guiScreen.getGuiBounds().getHeight(); } @Override - public int getScreenWidth() { + public int screenWidth() { return guiScreen.width; } @Override - public int getScreenHeight() { + public int screenHeight() { return guiScreen.height; } } diff --git a/common/src/main/java/dev/ftb/mods/ftbfiltersystem/integration/jei/JEIIntegration.java b/common/src/main/java/dev/ftb/mods/ftbfiltersystem/integration/jei/JEIIntegration.java index 1a64ca6..31d20a8 100644 --- a/common/src/main/java/dev/ftb/mods/ftbfiltersystem/integration/jei/JEIIntegration.java +++ b/common/src/main/java/dev/ftb/mods/ftbfiltersystem/integration/jei/JEIIntegration.java @@ -1,33 +1,32 @@ -//package dev.ftb.mods.ftbfiltersystem.integration.jei; -// -//import dev.ftb.mods.ftbfiltersystem.api.FTBFilterSystemAPI; -//import dev.ftb.mods.ftbfiltersystem.client.gui.ComponentConfigScreen; -//import dev.ftb.mods.ftbfiltersystem.client.gui.ItemConfigScreen; -//import dev.ftb.mods.ftbfiltersystem.client.gui.ModConfigScreen; -//import mezz.jei.api.IModPlugin; -//import mezz.jei.api.JeiPlugin; -//import mezz.jei.api.registration.IGuiHandlerRegistration; -//import net.minecraft.resources.ResourceLocation; -// -//@JeiPlugin -//public class JEIIntegration implements IModPlugin { -// private final ResourceLocation ID = FTBFilterSystemAPI.rl("default"); -// -// @Override -// public ResourceLocation getPluginUid() { -// return ID; -// } -// -// @Override -// public void registerGuiHandlers(IGuiHandlerRegistration registration) { -// registration.addGuiScreenHandler(ItemConfigScreen.class, new FFSScreenHandler<>()); -// registration.addGhostIngredientHandler(ItemConfigScreen.class, new FFSGhostHandler<>()); -// -// registration.addGuiScreenHandler(ComponentConfigScreen.class, new FFSScreenHandler<>()); -//// registration.addGhostIngredientHandler(NBTConfigScreen.class, new FFSGhostHandler<>(ItemStack::hasTag)); -// registration.addGhostIngredientHandler(ComponentConfigScreen.class, new FFSGhostHandler<>(s -> false)); -// -// registration.addGuiScreenHandler(ModConfigScreen.class, new FFSScreenHandler<>()); -// registration.addGhostIngredientHandler(ModConfigScreen.class, new FFSGhostHandler<>()); -// } -//} +package dev.ftb.mods.ftbfiltersystem.integration.jei; + +import dev.ftb.mods.ftbfiltersystem.api.FTBFilterSystemAPI; +import dev.ftb.mods.ftbfiltersystem.client.gui.ComponentConfigScreen; +import dev.ftb.mods.ftbfiltersystem.client.gui.ItemConfigScreen; +import dev.ftb.mods.ftbfiltersystem.client.gui.ModConfigScreen; +import mezz.jei.api.IModPlugin; +import mezz.jei.api.JeiPlugin; +import mezz.jei.api.registration.IGuiHandlerRegistration; +import net.minecraft.resources.ResourceLocation; + +@JeiPlugin +public class JEIIntegration implements IModPlugin { + private final ResourceLocation ID = FTBFilterSystemAPI.rl("default"); + + @Override + public ResourceLocation getPluginUid() { + return ID; + } + + @Override + public void registerGuiHandlers(IGuiHandlerRegistration registration) { + registration.addGuiScreenHandler(ItemConfigScreen.class, new FFSScreenHandler<>()); + registration.addGhostIngredientHandler(ItemConfigScreen.class, new FFSGhostHandler<>()); + + registration.addGuiScreenHandler(ComponentConfigScreen.class, new FFSScreenHandler<>()); + registration.addGhostIngredientHandler(ComponentConfigScreen.class, new FFSGhostHandler<>(s -> false)); + + registration.addGuiScreenHandler(ModConfigScreen.class, new FFSScreenHandler<>()); + registration.addGhostIngredientHandler(ModConfigScreen.class, new FFSGhostHandler<>()); + } +} diff --git a/fabric/src/main/resources/fabric.mod.json b/fabric/src/main/resources/fabric.mod.json index 50cf964..bd9b690 100644 --- a/fabric/src/main/resources/fabric.mod.json +++ b/fabric/src/main/resources/fabric.mod.json @@ -25,5 +25,8 @@ "fabric": "*", "minecraft": ">=1.20.1", "architectury": ">=9.1.12" + }, + "breaks": { + "jei": "<19.5.0.40" } } \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index 39e0447..c72e960 100644 --- a/gradle.properties +++ b/gradle.properties @@ -7,21 +7,20 @@ archives_base_name=ftb-filter-system readable_name=FTB Filter System maven_group=dev.ftb.mods -# TODO: Should we move this over to the neo format of 21.0.0 -mod_version=3.0.0 +mod_version=21.0.1 minecraft_version=1.21 -architectury_version=13.0.1 +architectury_version=13.0.2 fabric_loader_version=0.15.11 fabric_api_version=0.100.1+1.21 #forge_version=49.0.31 -neoforge_version=21.0.10-beta +neoforge_version=21.0.133-beta # https://maven.neoforged.net/#/releases/net/neoforged/fancymodloader/loader neoforge_loader_version=4 -jei_version=19.0.0.3 +jei_version=19.5.0.61 curseforge_id=943925 diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 20db9ad..2617362 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip networkTimeout=10000 zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/neoforge/build.gradle b/neoforge/build.gradle index 34aed0d..118b554 100644 --- a/neoforge/build.gradle +++ b/neoforge/build.gradle @@ -31,6 +31,7 @@ dependencies { modApi "dev.architectury:architectury-neoforge:${rootProject.architectury_version}" modCompileOnly("mezz.jei:jei-${rootProject.minecraft_version}-neoforge-api:${rootProject.jei_version}") + modRuntimeOnly("mezz.jei:jei-${rootProject.minecraft_version}-neoforge:${rootProject.jei_version}") common(project(path: ":common", configuration: "namedElements")) { transitive false } shadowCommon(project(path: ":common", configuration: "transformProductionNeoForge")) { transitive = false } diff --git a/neoforge/src/main/resources/META-INF/neoforge.mods.toml b/neoforge/src/main/resources/META-INF/neoforge.mods.toml index 1557fc0..3102127 100644 --- a/neoforge/src/main/resources/META-INF/neoforge.mods.toml +++ b/neoforge/src/main/resources/META-INF/neoforge.mods.toml @@ -32,4 +32,11 @@ modId = "architectury" type = "required" versionRange = "[${archversion},)" ordering = "AFTER" +side = "BOTH" + +[[dependencies.ftbfiltersystem]] +modId = "jei" +type = "optional" +versionRange = "[19.5.0.40,)" +ordering = "AFTER" side = "BOTH" \ No newline at end of file From 414a79443e064f8db6b1d167d6d91b64369d9aa7 Mon Sep 17 00:00:00 2001 From: UnRealDinnerbone Date: Thu, 25 Jul 2024 13:53:52 -0500 Subject: [PATCH 3/3] Fix recipe for smart filter --- .../data/ftbfiltersystem/{recipes => recipe}/smart_filter.json | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename common/src/main/resources/data/ftbfiltersystem/{recipes => recipe}/smart_filter.json (100%) diff --git a/common/src/main/resources/data/ftbfiltersystem/recipes/smart_filter.json b/common/src/main/resources/data/ftbfiltersystem/recipe/smart_filter.json similarity index 100% rename from common/src/main/resources/data/ftbfiltersystem/recipes/smart_filter.json rename to common/src/main/resources/data/ftbfiltersystem/recipe/smart_filter.json