From bf27e72ebedb486db065ed09652396c0b6ffee5e Mon Sep 17 00:00:00 2001 From: 90 <90@national.shitposting.agency> Date: Mon, 4 Jul 2022 22:08:18 +0100 Subject: [PATCH] "Improved" tooltip percentages mean jack shit when they're almost always going to be 0% code still sucks though --- .../ninety/megacells/item/MEGABulkCell.java | 22 ++++++++++++------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/src/main/java/ninety/megacells/item/MEGABulkCell.java b/src/main/java/ninety/megacells/item/MEGABulkCell.java index dee9d3b1..27bd9454 100644 --- a/src/main/java/ninety/megacells/item/MEGABulkCell.java +++ b/src/main/java/ninety/megacells/item/MEGABulkCell.java @@ -34,15 +34,21 @@ public void appendHoverText(ItemStack is, Level level, List lines, To return; } - double used = handler.getUsedBytes(); - lines.add(used == 0 ? Tooltips.of("Empty") - : Tooltips.of(Tooltips.of("Capacity Used: "), - Tooltips.ofPercent(used / (double) Integer.MAX_VALUE, false))); - var containedType = handler.getAvailableStacks().getFirstKey(); - if (containedType != null) { - var item = containedType.wrapForDisplayOrFilter(); - lines.add(Tooltips.of(Tooltips.of("Contains: "), Tooltips.of(item.getHoverName()))); + lines.add(containedType == null ? Tooltips.of("Empty") + : Tooltips.of(Tooltips.of("Contains: "), + Tooltips.of(containedType.wrapForDisplayOrFilter().getHoverName()))); + + var filterSlots = handler.getConfigInventory().keySet().stream().toList(); + if (!filterSlots.isEmpty()) { + if (filterSlots.size() == 1) { + lines.add(Tooltips.of(Tooltips.of("Partitioned for: "), filterSlots.get(0).getDisplayName())); + } else { + lines.add(Tooltips.of("Partitioned for:")); + for (var slot : filterSlots) { + lines.add(slot.getDisplayName()); + } + } } }