From b5426b26221667bf19ed33ee62719288bace7e35 Mon Sep 17 00:00:00 2001 From: TheRealWormbo Date: Tue, 2 Apr 2024 15:42:54 +0200 Subject: [PATCH] Add native EMI support for Forge - moved EMI plugin classes to XPlat - bumped compile-only EMI dependencies to version 1.0.12 (that's when "experimental" annotations were removed from some stable APIs) - bumped local test run EMI versions to 1.1.4 (latest release; only enabled for Fabric by default, JEI stays default for Forge) --- Fabric/build.gradle | 4 +++- Fabric/src/main/resources/fabric.mod.json | 2 +- Forge/build.gradle | 7 +++++++ Xplat/build.gradle | 5 +++++ .../client}/integration/emi/AncientWillEmiRecipe.java | 2 +- .../client}/integration/emi/BlendTextureWidget.java | 2 +- .../botania/client}/integration/emi/BotaniaEmiPlugin.java | 4 +++- .../botania/client}/integration/emi/BotaniaEmiRecipe.java | 2 +- .../client}/integration/emi/BotanicalBreweryEmiRecipe.java | 2 +- .../client}/integration/emi/CompositeLensEmiRecipe.java | 2 +- .../client}/integration/emi/ElvenTradeEmiRecipe.java | 2 +- .../client}/integration/emi/ManaInfusionEmiRecipe.java | 2 +- .../vazkii/botania/client}/integration/emi/ManaWidget.java | 2 +- .../client}/integration/emi/MarimorphosisEmiRecipe.java | 2 +- .../botania/client}/integration/emi/OrechidEmiRecipe.java | 2 +- .../client}/integration/emi/PetalApothecaryEmiRecipe.java | 2 +- .../client}/integration/emi/PureDaisyEmiRecipe.java | 2 +- .../client}/integration/emi/RunicAltarEmiRecipe.java | 2 +- .../integration/emi/TerrestrialAgglomerationEmiRecipe.java | 2 +- 19 files changed, 33 insertions(+), 17 deletions(-) rename {Fabric/src/main/java/vazkii/botania/fabric => Xplat/src/main/java/vazkii/botania/client}/integration/emi/AncientWillEmiRecipe.java (96%) rename {Fabric/src/main/java/vazkii/botania/fabric => Xplat/src/main/java/vazkii/botania/client}/integration/emi/BlendTextureWidget.java (92%) rename {Fabric/src/main/java/vazkii/botania/fabric => Xplat/src/main/java/vazkii/botania/client}/integration/emi/BotaniaEmiPlugin.java (99%) rename {Fabric/src/main/java/vazkii/botania/fabric => Xplat/src/main/java/vazkii/botania/client}/integration/emi/BotaniaEmiRecipe.java (96%) rename {Fabric/src/main/java/vazkii/botania/fabric => Xplat/src/main/java/vazkii/botania/client}/integration/emi/BotanicalBreweryEmiRecipe.java (97%) rename {Fabric/src/main/java/vazkii/botania/fabric => Xplat/src/main/java/vazkii/botania/client}/integration/emi/CompositeLensEmiRecipe.java (97%) rename {Fabric/src/main/java/vazkii/botania/fabric => Xplat/src/main/java/vazkii/botania/client}/integration/emi/ElvenTradeEmiRecipe.java (98%) rename {Fabric/src/main/java/vazkii/botania/fabric => Xplat/src/main/java/vazkii/botania/client}/integration/emi/ManaInfusionEmiRecipe.java (97%) rename {Fabric/src/main/java/vazkii/botania/fabric => Xplat/src/main/java/vazkii/botania/client}/integration/emi/ManaWidget.java (93%) rename {Fabric/src/main/java/vazkii/botania/fabric => Xplat/src/main/java/vazkii/botania/client}/integration/emi/MarimorphosisEmiRecipe.java (95%) rename {Fabric/src/main/java/vazkii/botania/fabric => Xplat/src/main/java/vazkii/botania/client}/integration/emi/OrechidEmiRecipe.java (98%) rename {Fabric/src/main/java/vazkii/botania/fabric => Xplat/src/main/java/vazkii/botania/client}/integration/emi/PetalApothecaryEmiRecipe.java (95%) rename {Fabric/src/main/java/vazkii/botania/fabric => Xplat/src/main/java/vazkii/botania/client}/integration/emi/PureDaisyEmiRecipe.java (97%) rename {Fabric/src/main/java/vazkii/botania/fabric => Xplat/src/main/java/vazkii/botania/client}/integration/emi/RunicAltarEmiRecipe.java (98%) rename {Fabric/src/main/java/vazkii/botania/fabric => Xplat/src/main/java/vazkii/botania/client}/integration/emi/TerrestrialAgglomerationEmiRecipe.java (96%) diff --git a/Fabric/build.gradle b/Fabric/build.gradle index 98d11e3cd1..b3d1f346c5 100644 --- a/Fabric/build.gradle +++ b/Fabric/build.gradle @@ -55,6 +55,7 @@ repositories { url = "https://maven.blamejared.com/" // for JEI and Patchouli } maven { + name = "TerraformersMC" url = "https://maven.terraformersmc.com/" // for trinkets and emi } maven { @@ -111,7 +112,8 @@ dependencies { modCompileOnly "me.shedaniel:RoughlyEnoughItems-fabric:12.0.625" - modImplementation("dev.emi:emi-fabric:1.0.4+1.20.1") { transitive = false } + modCompileOnly "dev.emi:emi-fabric:1.0.12+${minecraft_version}:api" + modLocalRuntime "dev.emi:emi-fabric:1.1.4+${minecraft_version}" modImplementation "me.zeroeightsix:fiber:0.23.0-2" include "me.zeroeightsix:fiber:0.23.0-2" diff --git a/Fabric/src/main/resources/fabric.mod.json b/Fabric/src/main/resources/fabric.mod.json index 6dc160a60d..6e1980b3f5 100644 --- a/Fabric/src/main/resources/fabric.mod.json +++ b/Fabric/src/main/resources/fabric.mod.json @@ -62,7 +62,7 @@ "vazkii.botania.fabric.internal_caps.CCAInternalEntityComponents" ], "emi": [ - "vazkii.botania.fabric.integration.emi.BotaniaEmiPlugin" + "vazkii.botania.client.integration.emi.BotaniaEmiPlugin" ], "rei_client": [ "vazkii.botania.fabric.integration.rei.BotaniaREIPlugin" diff --git a/Forge/build.gradle b/Forge/build.gradle index b805ccda6d..d18b73907d 100644 --- a/Forge/build.gradle +++ b/Forge/build.gradle @@ -38,6 +38,10 @@ repositories { name = "C4" url = "https://maven.theillusivec4.top/" } + maven { + name = "TerraformersMC" + url = "https://maven.terraformersmc.com/" // for emi + } maven { name = "Unascribed" url "https://repo.unascribed.com" // for ears @@ -103,6 +107,9 @@ dependencies { compileOnly fg.deobf("mezz.jei:jei-1.20.1-common-api:15.2.0.27") runtimeOnly fg.deobf("mezz.jei:jei-1.20.1-forge:15.2.0.27") + compileOnly fg.deobf("dev.emi:emi-forge:1.0.12+${minecraft_version}:api") + //runtimeOnly fg.deobf("dev.emi:emi-forge:1.1.4+${minecraft_version}") + compileOnly fg.deobf("top.theillusivec4.curios:curios-forge:5.4.2+1.20.1:api") runtimeOnly fg.deobf("top.theillusivec4.curios:curios-forge:5.4.2+1.20.1") diff --git a/Xplat/build.gradle b/Xplat/build.gradle index e760369f3a..4401bf82f2 100644 --- a/Xplat/build.gradle +++ b/Xplat/build.gradle @@ -19,6 +19,10 @@ repositories { name = "Jared" // Patchouli and JEI url = "https://maven.blamejared.com/" } + maven { + name = "TerraformersMC" + url = "https://maven.terraformersmc.com/" // for emi + } maven { name = "Unascribed" url "https://repo.unascribed.com" // for ears @@ -40,6 +44,7 @@ dependencies { compileOnly "com.unascribed:ears-api:1.4.5" compileOnly "mezz.jei:jei-1.20.1-common-api:15.2.0.27" + compileOnly "dev.emi:emi-xplat-mojmap:1.0.12+${minecraft_version}:api" // annotationProcessor 'com.blamejared.crafttweaker:Crafttweaker_Annotation_Processors-1.18.2:2.0.0.123' // annotationProcessor 'com.blamejared.crafttweaker:CraftTweaker-common-1.18.2:9.1.123' diff --git a/Fabric/src/main/java/vazkii/botania/fabric/integration/emi/AncientWillEmiRecipe.java b/Xplat/src/main/java/vazkii/botania/client/integration/emi/AncientWillEmiRecipe.java similarity index 96% rename from Fabric/src/main/java/vazkii/botania/fabric/integration/emi/AncientWillEmiRecipe.java rename to Xplat/src/main/java/vazkii/botania/client/integration/emi/AncientWillEmiRecipe.java index 8719351fcc..72f0f4e8a9 100644 --- a/Fabric/src/main/java/vazkii/botania/fabric/integration/emi/AncientWillEmiRecipe.java +++ b/Xplat/src/main/java/vazkii/botania/client/integration/emi/AncientWillEmiRecipe.java @@ -1,4 +1,4 @@ -package vazkii.botania.fabric.integration.emi; +package vazkii.botania.client.integration.emi; import dev.emi.emi.api.recipe.EmiPatternCraftingRecipe; import dev.emi.emi.api.stack.EmiIngredient; diff --git a/Fabric/src/main/java/vazkii/botania/fabric/integration/emi/BlendTextureWidget.java b/Xplat/src/main/java/vazkii/botania/client/integration/emi/BlendTextureWidget.java similarity index 92% rename from Fabric/src/main/java/vazkii/botania/fabric/integration/emi/BlendTextureWidget.java rename to Xplat/src/main/java/vazkii/botania/client/integration/emi/BlendTextureWidget.java index 1cf8bad39c..5f3ef4d460 100644 --- a/Fabric/src/main/java/vazkii/botania/fabric/integration/emi/BlendTextureWidget.java +++ b/Xplat/src/main/java/vazkii/botania/client/integration/emi/BlendTextureWidget.java @@ -1,4 +1,4 @@ -package vazkii.botania.fabric.integration.emi; +package vazkii.botania.client.integration.emi; import com.mojang.blaze3d.systems.RenderSystem; diff --git a/Fabric/src/main/java/vazkii/botania/fabric/integration/emi/BotaniaEmiPlugin.java b/Xplat/src/main/java/vazkii/botania/client/integration/emi/BotaniaEmiPlugin.java similarity index 99% rename from Fabric/src/main/java/vazkii/botania/fabric/integration/emi/BotaniaEmiPlugin.java rename to Xplat/src/main/java/vazkii/botania/client/integration/emi/BotaniaEmiPlugin.java index 2c7c1b55bb..22d1aff8a5 100644 --- a/Fabric/src/main/java/vazkii/botania/fabric/integration/emi/BotaniaEmiPlugin.java +++ b/Xplat/src/main/java/vazkii/botania/client/integration/emi/BotaniaEmiPlugin.java @@ -1,6 +1,7 @@ -package vazkii.botania.fabric.integration.emi; +package vazkii.botania.client.integration.emi; import dev.emi.emi.api.EmiApi; +import dev.emi.emi.api.EmiEntrypoint; import dev.emi.emi.api.EmiPlugin; import dev.emi.emi.api.EmiRegistry; import dev.emi.emi.api.recipe.EmiCraftingRecipe; @@ -43,6 +44,7 @@ import static vazkii.botania.common.lib.ResourceLocationHelper.prefix; +@EmiEntrypoint public class BotaniaEmiPlugin implements EmiPlugin { private static final Comparator BY_ID = Comparator.comparing(EmiRecipe::getId); private static final Comparator BY_GROUP = diff --git a/Fabric/src/main/java/vazkii/botania/fabric/integration/emi/BotaniaEmiRecipe.java b/Xplat/src/main/java/vazkii/botania/client/integration/emi/BotaniaEmiRecipe.java similarity index 96% rename from Fabric/src/main/java/vazkii/botania/fabric/integration/emi/BotaniaEmiRecipe.java rename to Xplat/src/main/java/vazkii/botania/client/integration/emi/BotaniaEmiRecipe.java index 706a97351d..ae51a95289 100644 --- a/Fabric/src/main/java/vazkii/botania/fabric/integration/emi/BotaniaEmiRecipe.java +++ b/Xplat/src/main/java/vazkii/botania/client/integration/emi/BotaniaEmiRecipe.java @@ -1,4 +1,4 @@ -package vazkii.botania.fabric.integration.emi; +package vazkii.botania.client.integration.emi; import dev.emi.emi.api.recipe.EmiRecipe; import dev.emi.emi.api.recipe.EmiRecipeCategory; diff --git a/Fabric/src/main/java/vazkii/botania/fabric/integration/emi/BotanicalBreweryEmiRecipe.java b/Xplat/src/main/java/vazkii/botania/client/integration/emi/BotanicalBreweryEmiRecipe.java similarity index 97% rename from Fabric/src/main/java/vazkii/botania/fabric/integration/emi/BotanicalBreweryEmiRecipe.java rename to Xplat/src/main/java/vazkii/botania/client/integration/emi/BotanicalBreweryEmiRecipe.java index ee1f7a5e63..d1735c3554 100644 --- a/Fabric/src/main/java/vazkii/botania/fabric/integration/emi/BotanicalBreweryEmiRecipe.java +++ b/Xplat/src/main/java/vazkii/botania/client/integration/emi/BotanicalBreweryEmiRecipe.java @@ -1,4 +1,4 @@ -package vazkii.botania.fabric.integration.emi; +package vazkii.botania.client.integration.emi; import dev.emi.emi.api.stack.EmiIngredient; import dev.emi.emi.api.stack.EmiStack; diff --git a/Fabric/src/main/java/vazkii/botania/fabric/integration/emi/CompositeLensEmiRecipe.java b/Xplat/src/main/java/vazkii/botania/client/integration/emi/CompositeLensEmiRecipe.java similarity index 97% rename from Fabric/src/main/java/vazkii/botania/fabric/integration/emi/CompositeLensEmiRecipe.java rename to Xplat/src/main/java/vazkii/botania/client/integration/emi/CompositeLensEmiRecipe.java index bc734f1dac..c470675e1b 100644 --- a/Fabric/src/main/java/vazkii/botania/fabric/integration/emi/CompositeLensEmiRecipe.java +++ b/Xplat/src/main/java/vazkii/botania/client/integration/emi/CompositeLensEmiRecipe.java @@ -1,4 +1,4 @@ -package vazkii.botania.fabric.integration.emi; +package vazkii.botania.client.integration.emi; import dev.emi.emi.api.recipe.EmiPatternCraftingRecipe; import dev.emi.emi.api.stack.EmiIngredient; diff --git a/Fabric/src/main/java/vazkii/botania/fabric/integration/emi/ElvenTradeEmiRecipe.java b/Xplat/src/main/java/vazkii/botania/client/integration/emi/ElvenTradeEmiRecipe.java similarity index 98% rename from Fabric/src/main/java/vazkii/botania/fabric/integration/emi/ElvenTradeEmiRecipe.java rename to Xplat/src/main/java/vazkii/botania/client/integration/emi/ElvenTradeEmiRecipe.java index f09b739ced..5793afbff3 100644 --- a/Fabric/src/main/java/vazkii/botania/fabric/integration/emi/ElvenTradeEmiRecipe.java +++ b/Xplat/src/main/java/vazkii/botania/client/integration/emi/ElvenTradeEmiRecipe.java @@ -1,4 +1,4 @@ -package vazkii.botania.fabric.integration.emi; +package vazkii.botania.client.integration.emi; import com.mojang.blaze3d.vertex.PoseStack; import com.mojang.blaze3d.vertex.VertexConsumer; diff --git a/Fabric/src/main/java/vazkii/botania/fabric/integration/emi/ManaInfusionEmiRecipe.java b/Xplat/src/main/java/vazkii/botania/client/integration/emi/ManaInfusionEmiRecipe.java similarity index 97% rename from Fabric/src/main/java/vazkii/botania/fabric/integration/emi/ManaInfusionEmiRecipe.java rename to Xplat/src/main/java/vazkii/botania/client/integration/emi/ManaInfusionEmiRecipe.java index adf6ec7ad1..9b0ec0792a 100644 --- a/Fabric/src/main/java/vazkii/botania/fabric/integration/emi/ManaInfusionEmiRecipe.java +++ b/Xplat/src/main/java/vazkii/botania/client/integration/emi/ManaInfusionEmiRecipe.java @@ -1,4 +1,4 @@ -package vazkii.botania.fabric.integration.emi; +package vazkii.botania.client.integration.emi; import dev.emi.emi.api.stack.EmiIngredient; import dev.emi.emi.api.stack.EmiStack; diff --git a/Fabric/src/main/java/vazkii/botania/fabric/integration/emi/ManaWidget.java b/Xplat/src/main/java/vazkii/botania/client/integration/emi/ManaWidget.java similarity index 93% rename from Fabric/src/main/java/vazkii/botania/fabric/integration/emi/ManaWidget.java rename to Xplat/src/main/java/vazkii/botania/client/integration/emi/ManaWidget.java index 4eb4cbf864..15c18c30d9 100644 --- a/Fabric/src/main/java/vazkii/botania/fabric/integration/emi/ManaWidget.java +++ b/Xplat/src/main/java/vazkii/botania/client/integration/emi/ManaWidget.java @@ -1,4 +1,4 @@ -package vazkii.botania.fabric.integration.emi; +package vazkii.botania.client.integration.emi; import dev.emi.emi.api.widget.Bounds; import dev.emi.emi.api.widget.Widget; diff --git a/Fabric/src/main/java/vazkii/botania/fabric/integration/emi/MarimorphosisEmiRecipe.java b/Xplat/src/main/java/vazkii/botania/client/integration/emi/MarimorphosisEmiRecipe.java similarity index 95% rename from Fabric/src/main/java/vazkii/botania/fabric/integration/emi/MarimorphosisEmiRecipe.java rename to Xplat/src/main/java/vazkii/botania/client/integration/emi/MarimorphosisEmiRecipe.java index 8022dfde7c..5306c48688 100644 --- a/Fabric/src/main/java/vazkii/botania/fabric/integration/emi/MarimorphosisEmiRecipe.java +++ b/Xplat/src/main/java/vazkii/botania/client/integration/emi/MarimorphosisEmiRecipe.java @@ -1,4 +1,4 @@ -package vazkii.botania.fabric.integration.emi; +package vazkii.botania.client.integration.emi; import dev.emi.emi.api.stack.EmiIngredient; diff --git a/Fabric/src/main/java/vazkii/botania/fabric/integration/emi/OrechidEmiRecipe.java b/Xplat/src/main/java/vazkii/botania/client/integration/emi/OrechidEmiRecipe.java similarity index 98% rename from Fabric/src/main/java/vazkii/botania/fabric/integration/emi/OrechidEmiRecipe.java rename to Xplat/src/main/java/vazkii/botania/client/integration/emi/OrechidEmiRecipe.java index 9d0488a1fe..49a90b1ac4 100644 --- a/Fabric/src/main/java/vazkii/botania/fabric/integration/emi/OrechidEmiRecipe.java +++ b/Xplat/src/main/java/vazkii/botania/client/integration/emi/OrechidEmiRecipe.java @@ -1,4 +1,4 @@ -package vazkii.botania.fabric.integration.emi; +package vazkii.botania.client.integration.emi; import dev.emi.emi.api.recipe.EmiRecipeCategory; import dev.emi.emi.api.stack.EmiIngredient; diff --git a/Fabric/src/main/java/vazkii/botania/fabric/integration/emi/PetalApothecaryEmiRecipe.java b/Xplat/src/main/java/vazkii/botania/client/integration/emi/PetalApothecaryEmiRecipe.java similarity index 95% rename from Fabric/src/main/java/vazkii/botania/fabric/integration/emi/PetalApothecaryEmiRecipe.java rename to Xplat/src/main/java/vazkii/botania/client/integration/emi/PetalApothecaryEmiRecipe.java index adc4c528bd..204db76757 100644 --- a/Fabric/src/main/java/vazkii/botania/fabric/integration/emi/PetalApothecaryEmiRecipe.java +++ b/Xplat/src/main/java/vazkii/botania/client/integration/emi/PetalApothecaryEmiRecipe.java @@ -1,4 +1,4 @@ -package vazkii.botania.fabric.integration.emi; +package vazkii.botania.client.integration.emi; import dev.emi.emi.api.stack.EmiIngredient; import dev.emi.emi.api.stack.EmiStack; diff --git a/Fabric/src/main/java/vazkii/botania/fabric/integration/emi/PureDaisyEmiRecipe.java b/Xplat/src/main/java/vazkii/botania/client/integration/emi/PureDaisyEmiRecipe.java similarity index 97% rename from Fabric/src/main/java/vazkii/botania/fabric/integration/emi/PureDaisyEmiRecipe.java rename to Xplat/src/main/java/vazkii/botania/client/integration/emi/PureDaisyEmiRecipe.java index 86fc8b491a..79cd3bf01e 100644 --- a/Fabric/src/main/java/vazkii/botania/fabric/integration/emi/PureDaisyEmiRecipe.java +++ b/Xplat/src/main/java/vazkii/botania/client/integration/emi/PureDaisyEmiRecipe.java @@ -1,4 +1,4 @@ -package vazkii.botania.fabric.integration.emi; +package vazkii.botania.client.integration.emi; import dev.emi.emi.api.recipe.EmiRecipe; import dev.emi.emi.api.stack.EmiIngredient; diff --git a/Fabric/src/main/java/vazkii/botania/fabric/integration/emi/RunicAltarEmiRecipe.java b/Xplat/src/main/java/vazkii/botania/client/integration/emi/RunicAltarEmiRecipe.java similarity index 98% rename from Fabric/src/main/java/vazkii/botania/fabric/integration/emi/RunicAltarEmiRecipe.java rename to Xplat/src/main/java/vazkii/botania/client/integration/emi/RunicAltarEmiRecipe.java index f0f024dbcc..54da138c80 100644 --- a/Fabric/src/main/java/vazkii/botania/fabric/integration/emi/RunicAltarEmiRecipe.java +++ b/Xplat/src/main/java/vazkii/botania/client/integration/emi/RunicAltarEmiRecipe.java @@ -1,4 +1,4 @@ -package vazkii.botania.fabric.integration.emi; +package vazkii.botania.client.integration.emi; import dev.emi.emi.api.recipe.EmiRecipe; import dev.emi.emi.api.stack.EmiIngredient; diff --git a/Fabric/src/main/java/vazkii/botania/fabric/integration/emi/TerrestrialAgglomerationEmiRecipe.java b/Xplat/src/main/java/vazkii/botania/client/integration/emi/TerrestrialAgglomerationEmiRecipe.java similarity index 96% rename from Fabric/src/main/java/vazkii/botania/fabric/integration/emi/TerrestrialAgglomerationEmiRecipe.java rename to Xplat/src/main/java/vazkii/botania/client/integration/emi/TerrestrialAgglomerationEmiRecipe.java index 7f5ff7588d..6be9ea11e8 100644 --- a/Fabric/src/main/java/vazkii/botania/fabric/integration/emi/TerrestrialAgglomerationEmiRecipe.java +++ b/Xplat/src/main/java/vazkii/botania/client/integration/emi/TerrestrialAgglomerationEmiRecipe.java @@ -1,4 +1,4 @@ -package vazkii.botania.fabric.integration.emi; +package vazkii.botania.client.integration.emi; import dev.emi.emi.api.stack.EmiIngredient; import dev.emi.emi.api.stack.EmiStack;