aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/me/shedaniel/rei/plugin/cooking/DefaultCookingDisplay.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/me/shedaniel/rei/plugin/cooking/DefaultCookingDisplay.java')
-rw-r--r--src/main/java/me/shedaniel/rei/plugin/cooking/DefaultCookingDisplay.java20
1 files changed, 14 insertions, 6 deletions
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<List<EntryStack>> input;
private static List<EntryStack> fuel;
- private List<EntryStack> 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<List<EntryStack>> input;
+ private List<EntryStack> 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<AbstractCookingRecipe> getOptionalRecipe() {
return Optional.ofNullable(recipe);
}