From 620b7b47c9c2a3d7e1f54c5a8c82113acaff7438 Mon Sep 17 00:00:00 2001 From: shedaniel Date: Wed, 12 Feb 2020 01:55:38 +0800 Subject: fix favorites saving Signed-off-by: shedaniel --- .../rei/plugin/cooking/DefaultCookingDisplay.java | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'src/main/java/me/shedaniel/rei/plugin/cooking/DefaultCookingDisplay.java') diff --git a/src/main/java/me/shedaniel/rei/plugin/cooking/DefaultCookingDisplay.java b/src/main/java/me/shedaniel/rei/plugin/cooking/DefaultCookingDisplay.java index 08c2845c5..890232d03 100644 --- a/src/main/java/me/shedaniel/rei/plugin/cooking/DefaultCookingDisplay.java +++ b/src/main/java/me/shedaniel/rei/plugin/cooking/DefaultCookingDisplay.java @@ -40,14 +40,7 @@ public abstract class DefaultCookingDisplay implements TransferRecipeDisplay { public DefaultCookingDisplay(AbstractCookingRecipe recipe) { this.recipe = recipe; - this.input = recipe.getPreviewInputs().stream().map(i -> { - List entries = new ArrayList<>(); - for (ItemStack stack : i.getMatchingStacksClient()) { - entries.add(EntryStack.create(stack)); - } - return entries; - }).collect(Collectors.toList()); - this.input.add(fuel); + this.input = CollectionUtils.map(recipe.getPreviewInputs(), i -> CollectionUtils.map(i.getMatchingStacksClient(), EntryStack::create)); this.output = Collections.singletonList(EntryStack.create(recipe.getOutput())); this.xp = recipe.getExperience(); this.cookTime = recipe.getCookTime(); @@ -81,6 +74,10 @@ public abstract class DefaultCookingDisplay implements TransferRecipeDisplay { return cookTime; } + public static List getFuel() { + return fuel; + } + @ApiStatus.Internal public Optional getOptionalRecipe() { return Optional.ofNullable(recipe); @@ -98,7 +95,7 @@ public abstract class DefaultCookingDisplay implements TransferRecipeDisplay { @Override public List> getOrganisedInputEntries(ContainerInfo containerInfo, Container container) { - return CollectionUtils.map(recipe.getPreviewInputs(), i -> CollectionUtils.map(i.getMatchingStacksClient(), EntryStack::create)); + return input; } } -- cgit