Fix apache.commons.compress crash

This commit is contained in:
oitsjustjose 2024-02-20 20:00:07 -06:00
commit 1b144aaa5f
3 changed files with 6 additions and 6 deletions

View file

@ -11,8 +11,8 @@ import net.minecraft.world.item.crafting.RecipeSerializer;
import net.minecraft.world.item.crafting.RecipeType;
import net.minecraftforge.registries.DeferredRegister;
import net.minecraftforge.registries.ForgeRegistries;
import org.apache.commons.compress.utils.Lists;
import java.util.ArrayList;
import java.util.List;
public class RecipeTypeRegistry {
@ -29,7 +29,7 @@ public class RecipeTypeRegistry {
private final List<BaseRecipe> allRecipes;
public RecipeTypeRegistry() {
this.allRecipes = Lists.newArrayList();
this.allRecipes = new ArrayList<>();
this.MOD = new ModRecipeSerializer();
this.MOD_TYPE = new ModRecipeType();

View file

@ -7,10 +7,10 @@ import net.minecraft.world.item.crafting.Ingredient;
import net.minecraft.world.item.crafting.RecipeSerializer;
import net.minecraft.world.item.crafting.ShapedRecipe;
import net.minecraftforge.common.crafting.CraftingHelper;
import org.apache.commons.compress.utils.Lists;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
@ -20,7 +20,7 @@ public class IngredientRecipeSerializer implements RecipeSerializer<IngredientRe
var input = Ingredient.fromJson(obj.get("input"), false);
var substitute = ShapedRecipe.itemStackFromJson(obj.getAsJsonObject("substitute"));
substitute.setCount(1);
List<String> tags = Lists.newArrayList();
List<String> tags = new ArrayList<>();
if (obj.has("tags")) {
obj.getAsJsonArray("tags").forEach(x -> tags.add(x.getAsString()));

View file

@ -7,10 +7,10 @@ import net.minecraft.world.item.crafting.Ingredient;
import net.minecraft.world.item.crafting.RecipeSerializer;
import net.minecraft.world.item.crafting.ShapedRecipe;
import net.minecraftforge.common.crafting.CraftingHelper;
import org.apache.commons.compress.utils.Lists;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
@ -20,7 +20,7 @@ public class ModRecipeSerializer implements RecipeSerializer<ModRecipe> {
var mod = obj.get("mod").getAsString();
var substitute = ShapedRecipe.itemStackFromJson(obj.getAsJsonObject("substitute"));
substitute.setCount(1);
List<String> tags = Lists.newArrayList();
List<String> tags = new ArrayList<>();
if (obj.has("tags")) {
obj.getAsJsonArray("tags").forEach(x -> tags.add(x.getAsString()));