diff options
| author | shedaniel <daniel@shedaniel.me> | 2020-01-03 23:20:31 +0800 |
|---|---|---|
| committer | shedaniel <daniel@shedaniel.me> | 2020-01-03 23:20:31 +0800 |
| commit | 2077ebf086543587c4fc7ca9b125809609f749b9 (patch) | |
| tree | 2d8bbbb075809c4dac0a701de238dfaf4d6b092a /src/main/java/me/shedaniel/rei/plugin/cooking/DefaultCookingDisplay.java | |
| parent | 3e5c16747b3403cc4cc725676c13ba50f04d3e9b (diff) | |
| download | RoughlyEnoughItems-2077ebf086543587c4fc7ca9b125809609f749b9.tar.gz RoughlyEnoughItems-2077ebf086543587c4fc7ca9b125809609f749b9.tar.bz2 RoughlyEnoughItems-2077ebf086543587c4fc7ca9b125809609f749b9.zip | |
Compact the design and add cooking xp details
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.java | 17 |
1 files changed, 12 insertions, 5 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 f1c33dd81..6c12064ec 100644 --- a/src/main/java/me/shedaniel/rei/plugin/cooking/DefaultCookingDisplay.java +++ b/src/main/java/me/shedaniel/rei/plugin/cooking/DefaultCookingDisplay.java @@ -27,7 +27,13 @@ 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()); + } public DefaultCookingDisplay(AbstractCookingRecipe recipe) { this.recipe = recipe; @@ -38,8 +44,9 @@ public abstract class DefaultCookingDisplay implements TransferRecipeDisplay { } return entries; }).collect(Collectors.toList()); - this.input.add(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())); + this.input.add(fuel); this.output = Collections.singletonList(EntryStack.create(recipe.getOutput())); + xp = recipe.getExperience(); } @Override @@ -57,15 +64,15 @@ public abstract class DefaultCookingDisplay implements TransferRecipeDisplay { return output; } - public List<EntryStack> getFuel() { - return input.get(1); - } - @Override public List<List<EntryStack>> getRequiredEntries() { return input; } + public float getXp() { + return xp; + } + @Deprecated public Optional<AbstractCookingRecipe> getOptionalRecipe() { return Optional.ofNullable(recipe); |
