diff --git a/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/world/item/crafting/RecipeManagerMixin.java b/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/world/item/crafting/RecipeManagerMixin.java index a815c1bb..1e2092a4 100644 --- a/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/world/item/crafting/RecipeManagerMixin.java +++ b/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/world/item/crafting/RecipeManagerMixin.java @@ -8,7 +8,6 @@ import com.google.gson.JsonParseException; import io.izzel.arclight.common.bridge.core.inventory.IInventoryBridge; import io.izzel.arclight.common.bridge.core.item.crafting.RecipeManagerBridge; import it.unimi.dsi.fastutil.objects.Object2ObjectLinkedOpenHashMap; -import net.minecraft.Util; import net.minecraft.core.Registry; import net.minecraft.resources.ResourceLocation; import net.minecraft.server.packs.resources.ResourceManager; @@ -20,6 +19,7 @@ import net.minecraft.world.item.crafting.RecipeManager; import net.minecraft.world.item.crafting.RecipeType; import net.minecraft.world.level.Level; import net.minecraftforge.common.crafting.CraftingHelper; +import net.minecraftforge.common.crafting.conditions.ICondition; import org.slf4j.Logger; import org.spongepowered.asm.mixin.Final; import org.spongepowered.asm.mixin.Mixin; @@ -38,8 +38,9 @@ public abstract class RecipeManagerMixin implements RecipeManagerBridge { @Shadow protected abstract > Map> byType(RecipeType recipeTypeIn); @Shadow private boolean hasErrors; @Shadow @Final private static Logger LOGGER; - @Shadow public static Recipe fromJson(ResourceLocation recipeId, JsonObject json) { return null; } + @Shadow(remap = false) public static Recipe fromJson(ResourceLocation recipeId, JsonObject json, ICondition.IContext context) { return null; } @Shadow private Map> byName; + @Shadow(remap = false) @Final private ICondition.IContext context; // @formatter:on /** @@ -63,11 +64,11 @@ public abstract class RecipeManagerMixin implements RecipeManagerBridge { continue; //Forge: filter anything beginning with "_" as it's used for metadata. try { - if (entry.getValue().isJsonObject() && !CraftingHelper.processConditions(entry.getValue().getAsJsonObject(), "conditions")) { + if (entry.getValue().isJsonObject() && !CraftingHelper.processConditions(entry.getValue().getAsJsonObject(), "conditions", this.context)) { LOGGER.info("Skipping loading recipe {} as it's conditions were not met", resourcelocation); continue; } - Recipe irecipe = fromJson(resourcelocation, GsonHelper.convertToJsonObject(entry.getValue(), "top element")); + Recipe irecipe = fromJson(resourcelocation, GsonHelper.convertToJsonObject(entry.getValue(), "top element"), this.context); if (irecipe == null) { LOGGER.info("Skipping loading recipe {} as it's serializer returned null", resourcelocation); continue; diff --git a/build.gradle b/build.gradle index 86bc4b7d..5921fc15 100644 --- a/build.gradle +++ b/build.gradle @@ -1,6 +1,6 @@ allprojects { group 'io.izzel.arclight' - version '1.0.2' + version '1.0.3-SNAPSHOT' def getGitHash = { -> def stdout = new ByteArrayOutputStream() @@ -14,7 +14,7 @@ allprojects { ext { agpVersion = '1.22' minecraftVersion = '1.18.2' - forgeVersion = '40.0.12' + forgeVersion = '40.0.36' apiVersion = '1.2.6' toolsVersion = '1.3.+' mixinVersion = '0.8.5'