diff options
| author | shedaniel <daniel@shedaniel.me> | 2020-07-14 11:19:19 +0800 |
|---|---|---|
| committer | shedaniel <daniel@shedaniel.me> | 2020-07-14 11:19:29 +0800 |
| commit | e2c264a82dc10b8e29b08225cd5bc24e689fa332 (patch) | |
| tree | 4adf065ef2183d7cb22b684806543121f9fb4359 /src/main/java/me/shedaniel/rei/plugin/brewing/DefaultBrewingDisplay.java | |
| parent | 1a6a10596fd0d9cc7e35419ced6fe056d93d7604 (diff) | |
| download | RoughlyEnoughItems-e2c264a82dc10b8e29b08225cd5bc24e689fa332.tar.gz RoughlyEnoughItems-e2c264a82dc10b8e29b08225cd5bc24e689fa332.tar.bz2 RoughlyEnoughItems-e2c264a82dc10b8e29b08225cd5bc24e689fa332.zip | |
Optimised craftable filter and changed some api
Signed-off-by: shedaniel <daniel@shedaniel.me>
Diffstat (limited to 'src/main/java/me/shedaniel/rei/plugin/brewing/DefaultBrewingDisplay.java')
| -rw-r--r-- | src/main/java/me/shedaniel/rei/plugin/brewing/DefaultBrewingDisplay.java | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/main/java/me/shedaniel/rei/plugin/brewing/DefaultBrewingDisplay.java b/src/main/java/me/shedaniel/rei/plugin/brewing/DefaultBrewingDisplay.java index 5ab1f94cb..2c81519e1 100644 --- a/src/main/java/me/shedaniel/rei/plugin/brewing/DefaultBrewingDisplay.java +++ b/src/main/java/me/shedaniel/rei/plugin/brewing/DefaultBrewingDisplay.java @@ -27,6 +27,8 @@ import com.google.common.collect.Lists; import me.shedaniel.rei.api.EntryStack; import me.shedaniel.rei.api.RecipeDisplay; import me.shedaniel.rei.plugin.DefaultPlugin; +import net.fabricmc.api.EnvType; +import net.fabricmc.api.Environment; import net.minecraft.item.ItemStack; import net.minecraft.recipe.Ingredient; import net.minecraft.text.TranslatableText; @@ -37,6 +39,7 @@ import java.util.ArrayList; import java.util.Collections; import java.util.List; +@Environment(EnvType.CLIENT) public class DefaultBrewingDisplay implements RecipeDisplay { private EntryStack input, output; @@ -44,8 +47,9 @@ public class DefaultBrewingDisplay implements RecipeDisplay { public DefaultBrewingDisplay(ItemStack input, Ingredient reactant, ItemStack output) { this.input = EntryStack.create(input).setting(EntryStack.Settings.TOOLTIP_APPEND_EXTRA, stack -> Collections.singletonList(new TranslatableText("category.rei.brewing.input").formatted(Formatting.YELLOW))); - this.reactant = new ArrayList<>(); - for (ItemStack stack : reactant.getMatchingStacksClient()) { + ItemStack[] reactantStacks = reactant.getMatchingStacksClient(); + this.reactant = new ArrayList<>(reactantStacks.length); + for (ItemStack stack : reactantStacks) { EntryStack entryStack = EntryStack.create(stack); entryStack.setting(EntryStack.Settings.TOOLTIP_APPEND_EXTRA, s -> Collections.singletonList(new TranslatableText("category.rei.brewing.reactant").formatted(Formatting.YELLOW))); this.reactant.add(entryStack); |
