diff options
Diffstat (limited to 'default-plugin/src/main/java/me/shedaniel/rei/plugin')
2 files changed, 8 insertions, 9 deletions
diff --git a/default-plugin/src/main/java/me/shedaniel/rei/plugin/brewing/DefaultBrewingDisplay.java b/default-plugin/src/main/java/me/shedaniel/rei/plugin/brewing/DefaultBrewingDisplay.java index e3b4843b6..be45551b2 100644 --- a/default-plugin/src/main/java/me/shedaniel/rei/plugin/brewing/DefaultBrewingDisplay.java +++ b/default-plugin/src/main/java/me/shedaniel/rei/plugin/brewing/DefaultBrewingDisplay.java @@ -52,20 +52,16 @@ public class DefaultBrewingDisplay implements Display { ItemStack[] inputItems = input.getItems(); List<EntryStack<?>> i = new ArrayList<>(inputItems.length); for (ItemStack inputItem : inputItems) { - EntryStack<?> entryStack = EntryStacks.of(inputItem); - entryStack.setting(EntryStack.Settings.TOOLTIP_APPEND_EXTRA, s -> Collections.singletonList(new TranslatableComponent("category.rei.brewing.input").withStyle(ChatFormatting.YELLOW))); - i.add(entryStack); + i.add(EntryStacks.of(inputItem).tooltip(new TranslatableComponent("category.rei.brewing.input").withStyle(ChatFormatting.YELLOW))); } this.input = EntryIngredient.of(i); ItemStack[] reactantStacks = reactant.getItems(); List<EntryStack<?>> r = new ArrayList<>(reactantStacks.length); for (ItemStack stack : reactantStacks) { - EntryStack<?> entryStack = EntryStacks.of(stack); - entryStack.setting(EntryStack.Settings.TOOLTIP_APPEND_EXTRA, s -> Collections.singletonList(new TranslatableComponent("category.rei.brewing.reactant").withStyle(ChatFormatting.YELLOW))); - r.add(entryStack); + r.add(EntryStacks.of(stack).tooltip(new TranslatableComponent("category.rei.brewing.reactant").withStyle(ChatFormatting.YELLOW))); } this.reactant = EntryIngredient.of(r); - this.output = EntryStacks.of(output).setting(EntryStack.Settings.TOOLTIP_APPEND_EXTRA, stack -> Collections.singletonList(new TranslatableComponent("category.rei.brewing.result").withStyle(ChatFormatting.YELLOW))); + this.output = EntryStacks.of(output).tooltip(new TranslatableComponent("category.rei.brewing.result").withStyle(ChatFormatting.YELLOW)); } @Override diff --git a/default-plugin/src/main/java/me/shedaniel/rei/plugin/composting/DefaultCompostingCategory.java b/default-plugin/src/main/java/me/shedaniel/rei/plugin/composting/DefaultCompostingCategory.java index 41aebe62d..7638f363b 100644 --- a/default-plugin/src/main/java/me/shedaniel/rei/plugin/composting/DefaultCompostingCategory.java +++ b/default-plugin/src/main/java/me/shedaniel/rei/plugin/composting/DefaultCompostingCategory.java @@ -46,7 +46,10 @@ import net.minecraft.resources.ResourceLocation; import net.minecraft.util.Mth; import net.minecraft.world.level.block.Blocks; -import java.util.*; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; @Environment(EnvType.CLIENT) public class DefaultCompostingCategory implements DisplayCategory<DefaultCompostingDisplay> { @@ -94,7 +97,7 @@ public class DefaultCompostingCategory implements DisplayCategory<DefaultCompost if (!entryStack.isEmpty()) { display.getInputMap().object2FloatEntrySet().stream().filter(entry -> entry.getKey() != null && Objects.equals(entry.getKey().asItem(), entryStack.get(0).getValue())).findAny().map(Map.Entry::getValue).ifPresent(chance -> { for (EntryStack<?> stack : entryStack) { - stack.setting(EntryStack.Settings.TOOLTIP_APPEND_EXTRA, s -> Collections.singletonList(new TranslatableComponent("text.rei.composting.chance", Mth.fastFloor(chance * 100)).withStyle(ChatFormatting.YELLOW))); + stack.tooltip(new TranslatableComponent("text.rei.composting.chance", Mth.fastFloor(chance * 100)).withStyle(ChatFormatting.YELLOW)); } }); } |
