Update forge 40.0.36

This commit is contained in:
IzzelAliz 2022-04-03 21:02:00 +08:00
parent dd338d5a45
commit 11a4d57122
No known key found for this signature in database
GPG Key ID: EE50E123A11D8338
2 changed files with 7 additions and 6 deletions

View File

@ -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 <C extends Container, T extends Recipe<C>> Map<ResourceLocation, Recipe<C>> byType(RecipeType<T> 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<ResourceLocation, Recipe<?>> 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;

View File

@ -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'