mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-24 22:14:32 +00:00
Compiling fixes - IN GAME!
This commit is contained in:
1 parent
631230b298
commit
80eb12e59d
364 files changed
+1170
-9853
No files matched your search
@@ -23,7 +23,6 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.JsonArray;
|
||||
import com.google.gson.JsonElement;
|
||||
import com.google.gson.JsonObject;
|
||||
@@ -31,7 +30,6 @@ import com.google.gson.JsonSyntaxException;
|
||||
|
||||
import net.minecraft.advancements.Advancement;
|
||||
import net.minecraft.util.JSONUtils;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.common.crafting.conditions.ICondition;
|
||||
|
||||
public class ConditionalAdvancement
|
||||
@@ -41,14 +39,11 @@ public class ConditionalAdvancement
|
||||
return new Builder();
|
||||
}
|
||||
|
||||
public static Advancement.Builder read(Gson gson, ResourceLocation recipeId, JsonObject json)
|
||||
{
|
||||
public static boolean processConditions(JsonObject json) {
|
||||
JsonArray entries = JSONUtils.getJsonArray(json, "advancements", null);
|
||||
if (entries == null)
|
||||
{
|
||||
if (!CraftingHelper.processConditions(json, "conditions"))
|
||||
return null;
|
||||
return gson.fromJson(json, Advancement.Builder.class);
|
||||
return CraftingHelper.processConditions(json, "conditions");
|
||||
}
|
||||
|
||||
int idx = 0;
|
||||
@@ -57,10 +52,10 @@ public class ConditionalAdvancement
|
||||
if (!ele.isJsonObject())
|
||||
throw new JsonSyntaxException("Invalid advancement entry at index " + idx + " Must be JsonObject");
|
||||
if (CraftingHelper.processConditions(JSONUtils.getJsonArray(ele.getAsJsonObject(), "conditions")))
|
||||
return gson.fromJson(JSONUtils.getJsonObject(ele.getAsJsonObject(), "advancement"), Advancement.Builder.class);
|
||||
return true;
|
||||
idx++;
|
||||
}
|
||||
return null;
|
||||
return false;
|
||||
}
|
||||
|
||||
public static class Builder
|
||||
|
||||
Reference in new issue
Block a user