Ported to 1.16.2-pre

This commit is contained in:
Sebastian Hartte
2020-08-01 17:14:12 +02:00
parent 3d1a919e69
commit 1b31185cdb
90 changed files with 356 additions and 258 deletions
@@ -19,7 +19,7 @@ public final class GrinderRecipes {
@Nullable
public static GrinderRecipe findForInput(World world, ItemStack input) {
// FIXME: this is slow, this creates a full copy of the list everytime
List<GrinderRecipe> grinderRecipes = world.getRecipeManager().method_30027(GrinderRecipe.TYPE);
List<GrinderRecipe> grinderRecipes = world.getRecipeManager().listAllOfType(GrinderRecipe.TYPE);
for (GrinderRecipe recipe : grinderRecipes) {
if (recipe.getIngredient().test(input) && input.getCount() >= recipe.getIngredientCount()) {
return recipe;
@@ -34,7 +34,7 @@ public final class GrinderRecipes {
*/
public static boolean isValidIngredient(World world, ItemStack stack) {
// FIXME: this is slow, this creates a full copy of the list everytime
List<GrinderRecipe> grinderRecipes = world.getRecipeManager().method_30027(GrinderRecipe.TYPE);
List<GrinderRecipe> grinderRecipes = world.getRecipeManager().listAllOfType(GrinderRecipe.TYPE);
for (GrinderRecipe recipe : grinderRecipes) {
if (recipe.getIngredient().test(stack)) {
return true;
@@ -3,8 +3,6 @@ package appeng.recipes.handlers;
import net.minecraft.inventory.Inventory;
import net.minecraft.item.ItemStack;
import net.minecraft.recipe.*;
import net.minecraft.recipe.Ingredient;
import net.minecraft.recipe.Recipe;
import net.minecraft.util.Identifier;
import net.minecraft.util.collection.DefaultedList;
import net.minecraft.world.World;