From 9e29f584f4fa1e4f2216ec6f8a4a8190f1fc1eaa Mon Sep 17 00:00:00 2001 From: 90 Date: Mon, 17 Apr 2023 05:01:40 +0100 Subject: [PATCH] Fix critical bulk cell dupe bug --- .../main/java/gripe/_90/megacells/item/MEGABulkCell.java | 6 +++++- .../gripe/_90/megacells/item/cell/BulkCellInventory.java | 4 +++- gradle.properties | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/common/src/main/java/gripe/_90/megacells/item/MEGABulkCell.java b/common/src/main/java/gripe/_90/megacells/item/MEGABulkCell.java index 13ad82de..44ce7c42 100644 --- a/common/src/main/java/gripe/_90/megacells/item/MEGABulkCell.java +++ b/common/src/main/java/gripe/_90/megacells/item/MEGABulkCell.java @@ -66,7 +66,11 @@ public void appendHoverText(ItemStack is, Level level, @NotNull List } } } else { - lines.add(Tooltips.of(MEGATranslations.NotPartitioned.text())); + if (storedItem != null) { + lines.add(MEGATranslations.MismatchedFilter.text().withStyle(ChatFormatting.DARK_RED)); + } else { + lines.add(MEGATranslations.NotPartitioned.text()); + } } lines.add(Tooltips.of(MEGATranslations.Compression.text(inv.compressionEnabled diff --git a/common/src/main/java/gripe/_90/megacells/item/cell/BulkCellInventory.java b/common/src/main/java/gripe/_90/megacells/item/cell/BulkCellInventory.java index 15a34e13..2597b90b 100644 --- a/common/src/main/java/gripe/_90/megacells/item/cell/BulkCellInventory.java +++ b/common/src/main/java/gripe/_90/megacells/item/cell/BulkCellInventory.java @@ -93,9 +93,11 @@ public CellState getStatus() { if (unitCount.signum() == 0) { return CellState.EMPTY; } + if (!storedItem.equals(filterItem)) { return CellState.FULL; } + return CellState.NOT_EMPTY; } @@ -155,7 +157,7 @@ public long extract(AEKey what, long amount, Actionable mode, IActionSource sour return 0; } - if (compressionEnabled && !storedItem.equals(what) + if (compressionEnabled && !storedItem.equals(what) && !filterItem.equals(what) && !compressed.containsKey(item) && !decompressed.containsKey(item)) { return 0; } diff --git a/gradle.properties b/gradle.properties index 281e6cc0..168b0c1c 100644 --- a/gradle.properties +++ b/gradle.properties @@ -7,7 +7,7 @@ mavenGroup=gripe.90 minecraftVersion=1.19.2 javaVersion=17 -ae2Version=12.9.2 +ae2Version=12.9.3 ae2wtVersion=12.8.4 appbotVersion=1.4.1