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 7863715a..a9b031f9 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 @@ -65,23 +65,14 @@ public BulkCellInventory(MEGABulkCell cell, ItemStack o, ISaveProvider container this.unitFactor = decompressed.values().intStream().asLongStream().reduce(1, Math::multiplyExact); this.storedItem = getTag().contains(KEY) ? AEItemKey.fromTag(getTag().getCompound(KEY)) : null; - this.unitCount = retrieveUnitCount(); + this.unitCount = !getTag().getString(UNIT_COUNT).equals("") + ? new BigInteger(getTag().getString(UNIT_COUNT)) + : BigInteger.ZERO; this.highestCompressed = storedItem; this.compressionEnabled = cell.getUpgrades(i).isInstalled(COMPRESSION_CARD); } - private BigInteger retrieveUnitCount() { - // TODO 1.19.3 / 1.20.0: Remove pre-2.0.0 bulk cell conversion (again) - if (getTag().contains("count")) { - return BigInteger.valueOf(getTag().getLong("count")).multiply(BigInteger.valueOf(unitFactor)); - } else { - return !getTag().getString(UNIT_COUNT).equals("") - ? new BigInteger(getTag().getString(UNIT_COUNT)) - : BigInteger.ZERO; - } - } - private long clampedLong(BigInteger toClamp, long limit) { return toClamp.min(BigInteger.valueOf(limit)).longValue(); } @@ -238,9 +229,6 @@ public void persist() { getTag().putString(UNIT_COUNT, unitCount.toString()); } - // remove pre-2.0.0 count tag - getTag().remove("count"); - isPersisted = true; }