diff --git a/common/src/main/java/gripe/_90/megacells/MEGACells.java b/common/src/main/java/gripe/_90/megacells/MEGACells.java index b8b6833c..d8e299be 100644 --- a/common/src/main/java/gripe/_90/megacells/MEGACells.java +++ b/common/src/main/java/gripe/_90/megacells/MEGACells.java @@ -29,7 +29,7 @@ import gripe._90.megacells.integration.ae2wt.AE2WTIntegration; import gripe._90.megacells.integration.appbot.AppBotIntegration; import gripe._90.megacells.integration.appbot.AppBotItems; -import gripe._90.megacells.item.MEGABulkCell; +import gripe._90.megacells.item.cell.MEGABulkCell; public final class MEGACells { private MEGACells() {} diff --git a/common/src/main/java/gripe/_90/megacells/definition/MEGAItems.java b/common/src/main/java/gripe/_90/megacells/definition/MEGAItems.java index 2819b481..7ce9b65c 100644 --- a/common/src/main/java/gripe/_90/megacells/definition/MEGAItems.java +++ b/common/src/main/java/gripe/_90/megacells/definition/MEGAItems.java @@ -24,8 +24,8 @@ import gripe._90.megacells.MEGACells; import gripe._90.megacells.crafting.DecompressionPatternItem; -import gripe._90.megacells.item.MEGABulkCell; -import gripe._90.megacells.item.MEGAPortableCell; +import gripe._90.megacells.item.cell.MEGABulkCell; +import gripe._90.megacells.item.cell.MEGAPortableCell; import gripe._90.megacells.item.part.DecompressionModulePart; import gripe._90.megacells.item.part.MEGAInterfacePart; import gripe._90.megacells.item.part.MEGAPatternProviderPart; 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 52a93d0c..5021cd7a 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 @@ -17,7 +17,6 @@ import appeng.api.storage.cells.ISaveProvider; import appeng.api.storage.cells.StorageCell; -import gripe._90.megacells.item.MEGABulkCell; import gripe._90.megacells.util.CompressionChain; import gripe._90.megacells.util.CompressionService; @@ -27,7 +26,7 @@ public class BulkCellInventory implements StorageCell { private static final long STACK_LIMIT = (long) Math.pow(2, 42); private final ISaveProvider container; - private final ItemStack i; + private final ItemStack stack; private AEItemKey storedItem; private final AEItemKey filterItem; @@ -39,17 +38,17 @@ public class BulkCellInventory implements StorageCell { private boolean isPersisted = true; - public BulkCellInventory(MEGABulkCell cell, ItemStack o, ISaveProvider container) { - this.i = o; + public BulkCellInventory(MEGABulkCell cell, ItemStack stack, ISaveProvider container) { + this.stack = stack; this.container = container; - filterItem = (AEItemKey) cell.getConfigInventory(i).getKey(0); + filterItem = (AEItemKey) cell.getConfigInventory(this.stack).getKey(0); storedItem = getTag().contains(KEY) ? AEItemKey.fromTag(getTag().getCompound(KEY)) : null; unitCount = !getTag().getString(UNIT_COUNT).isEmpty() ? new BigInteger(getTag().getString(UNIT_COUNT)) : BigInteger.ZERO; - compressionEnabled = cell.getUpgrades(i).isInstalled(COMPRESSION_CARD); + compressionEnabled = cell.getUpgrades(this.stack).isInstalled(COMPRESSION_CARD); compressionChain = CompressionService.INSTANCE .getChain(storedItem != null ? storedItem : filterItem) .orElseGet(CompressionChain::new); @@ -61,7 +60,7 @@ private long clampedLong(BigInteger toClamp, long limit) { } private CompoundTag getTag() { - return i.getOrCreateTag(); + return stack.getOrCreateTag(); } @Override @@ -231,6 +230,6 @@ public void getAvailableStacks(KeyCounter out) { @Override public Component getDescription() { - return i.getHoverName(); + return stack.getHoverName(); } } diff --git a/common/src/main/java/gripe/_90/megacells/item/MEGABulkCell.java b/common/src/main/java/gripe/_90/megacells/item/cell/MEGABulkCell.java similarity index 98% rename from common/src/main/java/gripe/_90/megacells/item/MEGABulkCell.java rename to common/src/main/java/gripe/_90/megacells/item/cell/MEGABulkCell.java index 61e7d7f2..087a960c 100644 --- a/common/src/main/java/gripe/_90/megacells/item/MEGABulkCell.java +++ b/common/src/main/java/gripe/_90/megacells/item/cell/MEGABulkCell.java @@ -1,4 +1,4 @@ -package gripe._90.megacells.item; +package gripe._90.megacells.item.cell; import java.util.ArrayList; import java.util.List; @@ -32,7 +32,6 @@ import gripe._90.megacells.definition.MEGAItems; import gripe._90.megacells.definition.MEGATranslations; -import gripe._90.megacells.item.cell.BulkCellInventory; public class MEGABulkCell extends AEBaseItem implements ICellWorkbenchItem { public static final Handler HANDLER = new Handler(); @@ -46,6 +45,11 @@ public ConfigInventory getConfigInventory(ItemStack is) { return CellConfig.create(AEItemKey.filter(), is, 1); } + @Override + public IUpgradeInventory getUpgrades(ItemStack is) { + return UpgradeInventories.forItem(is, 1); + } + @Override public void appendHoverText(ItemStack is, Level level, @NotNull List lines, @NotNull TooltipFlag adv) { var inv = HANDLER.getCellInventory(is, null); @@ -114,11 +118,6 @@ public Optional getTooltipImage(ItemStack is) { return Optional.of(new StorageCellTooltipComponent(upgrades, content, false, true)); } - @Override - public IUpgradeInventory getUpgrades(ItemStack is) { - return UpgradeInventories.forItem(is, 1); - } - @Override public FuzzyMode getFuzzyMode(ItemStack itemStack) { return null; diff --git a/common/src/main/java/gripe/_90/megacells/item/MEGAPortableCell.java b/common/src/main/java/gripe/_90/megacells/item/cell/MEGAPortableCell.java similarity index 97% rename from common/src/main/java/gripe/_90/megacells/item/MEGAPortableCell.java rename to common/src/main/java/gripe/_90/megacells/item/cell/MEGAPortableCell.java index a94ec12a..7750721a 100644 --- a/common/src/main/java/gripe/_90/megacells/item/MEGAPortableCell.java +++ b/common/src/main/java/gripe/_90/megacells/item/cell/MEGAPortableCell.java @@ -1,4 +1,4 @@ -package gripe._90.megacells.item; +package gripe._90.megacells.item.cell; import java.util.Objects; diff --git a/common/src/main/java/gripe/_90/megacells/util/CompressionService.java b/common/src/main/java/gripe/_90/megacells/util/CompressionService.java index 26ff5ede..9939008c 100644 --- a/common/src/main/java/gripe/_90/megacells/util/CompressionService.java +++ b/common/src/main/java/gripe/_90/megacells/util/CompressionService.java @@ -6,7 +6,6 @@ import java.util.Set; import java.util.stream.Stream; -import gripe._90.megacells.MEGACells; import it.unimi.dsi.fastutil.objects.ObjectArrayList; import it.unimi.dsi.fastutil.objects.ObjectLinkedOpenHashSet; @@ -19,6 +18,7 @@ import appeng.api.stacks.AEItemKey; +import gripe._90.megacells.MEGACells; import gripe._90.megacells.definition.MEGATags; public class CompressionService { diff --git a/forge/src/main/java/gripe/_90/megacells/integration/appmek/item/MEGAPortableChemicalCell.java b/forge/src/main/java/gripe/_90/megacells/integration/appmek/item/MEGAPortableChemicalCell.java index 17f0f25f..b50484c6 100644 --- a/forge/src/main/java/gripe/_90/megacells/integration/appmek/item/MEGAPortableChemicalCell.java +++ b/forge/src/main/java/gripe/_90/megacells/integration/appmek/item/MEGAPortableChemicalCell.java @@ -10,7 +10,7 @@ import me.ramidzkh.mekae2.ae2.MekanismKeyType; import mekanism.api.chemical.attribute.ChemicalAttributeValidator; -import gripe._90.megacells.item.MEGAPortableCell; +import gripe._90.megacells.item.cell.MEGAPortableCell; public class MEGAPortableChemicalCell extends MEGAPortableCell { public MEGAPortableChemicalCell(Properties props, StorageTier tier, int defaultColour) {