From 7a1cf35934ef14c04f884fe6ae34282e1d6243ba Mon Sep 17 00:00:00 2001 From: shedaniel Date: Fri, 17 Jan 2020 14:31:30 +0800 Subject: 3.3.12 --- .../rei/plugin/cooking/DefaultCookingDisplay.java | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 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 6c12064ec..a031ea0ed 100644 --- a/src/main/java/me/shedaniel/rei/plugin/cooking/DefaultCookingDisplay.java +++ b/src/main/java/me/shedaniel/rei/plugin/cooking/DefaultCookingDisplay.java @@ -17,6 +17,7 @@ import net.minecraft.item.ItemStack; import net.minecraft.recipe.AbstractCookingRecipe; import net.minecraft.util.Formatting; import net.minecraft.util.Identifier; +import org.jetbrains.annotations.ApiStatus; import java.util.ArrayList; import java.util.Collections; @@ -25,16 +26,18 @@ import java.util.Optional; import java.util.stream.Collectors; public abstract class DefaultCookingDisplay implements TransferRecipeDisplay { - private AbstractCookingRecipe recipe; - private List> input; private static List fuel; - private List output; - private float xp; static { fuel = FurnaceBlockEntity.createFuelTimeMap().keySet().stream().map(Item::getStackForRender).map(EntryStack::create).map(e -> e.setting(EntryStack.Settings.TOOLTIP_APPEND_EXTRA, stack -> Collections.singletonList(Formatting.YELLOW.toString() + I18n.translate("category.rei.smelting.fuel")))).collect(Collectors.toList()); } + private AbstractCookingRecipe recipe; + private List> input; + private List output; + private float xp; + private double cookTime; + public DefaultCookingDisplay(AbstractCookingRecipe recipe) { this.recipe = recipe; this.input = recipe.getPreviewInputs().stream().map(i -> { @@ -46,7 +49,8 @@ public abstract class DefaultCookingDisplay implements TransferRecipeDisplay { }).collect(Collectors.toList()); this.input.add(fuel); this.output = Collections.singletonList(EntryStack.create(recipe.getOutput())); - xp = recipe.getExperience(); + this.xp = recipe.getExperience(); + this.cookTime = recipe.getCookTime(); } @Override @@ -73,7 +77,11 @@ public abstract class DefaultCookingDisplay implements TransferRecipeDisplay { return xp; } - @Deprecated + public double getCookingTime() { + return cookTime; + } + + @ApiStatus.Internal public Optional getOptionalRecipe() { return Optional.ofNullable(recipe); } -- cgit