Skip to content

Commit

Permalink
Rework indexing for MEGA tiers
Browse files Browse the repository at this point in the history
Fixes #106
  • Loading branch information
62832 committed Feb 13, 2024
1 parent 8374361 commit 0f72f5b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,11 @@ public static List<ItemDefinition<?>> getItems() {
public static final ItemDefinition<StorageComponentItem> CELL_COMPONENT_64M = component(64);
public static final ItemDefinition<StorageComponentItem> CELL_COMPONENT_256M = component(256);

public static final StorageTier TIER_1M = tier(1, CELL_COMPONENT_1M);
public static final StorageTier TIER_4M = tier(2, CELL_COMPONENT_4M);
public static final StorageTier TIER_16M = tier(3, CELL_COMPONENT_16M);
public static final StorageTier TIER_64M = tier(4, CELL_COMPONENT_64M);
public static final StorageTier TIER_256M = tier(5, CELL_COMPONENT_256M);
public static final StorageTier TIER_1M = tier(6, CELL_COMPONENT_1M);
public static final StorageTier TIER_4M = tier(7, CELL_COMPONENT_4M);
public static final StorageTier TIER_16M = tier(8, CELL_COMPONENT_16M);
public static final StorageTier TIER_64M = tier(9, CELL_COMPONENT_64M);
public static final StorageTier TIER_256M = tier(10, CELL_COMPONENT_256M);

public static final ItemDefinition<BasicStorageCell> ITEM_CELL_1M = itemCell(TIER_1M);
public static final ItemDefinition<BasicStorageCell> ITEM_CELL_4M = itemCell(TIER_4M);
Expand Down Expand Up @@ -155,7 +155,7 @@ public static List<ItemDefinition<? extends AbstractPortableCell>> getFluidPorta
private static StorageTier tier(int index, ItemDefinition<StorageComponentItem> component) {
int multiplier = (int) Math.pow(4, index - 1);
return new StorageTier(
index, multiplier + "m", 1048576 * multiplier, 2.5 + 0.5 * multiplier, component::asItem);
index, (multiplier / 1024) + "m", 1024 * multiplier, 0.5 * multiplier, component::asItem);
}

private static ItemDefinition<StorageComponentItem> component(int mb) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public MEGAPortableCell(
Properties props, StorageTier tier, AEKeyType keyType, MenuType<MEStorageMenu> menu, int defaultColour) {
super(
keyType,
18 + (keyType.equals(AEKeyType.items()) ? tier.index() * 9 : 0),
18 + (keyType.equals(AEKeyType.items()) ? (tier.index() - 5) * 9 : 0),
menu,
tier,
props.stacksTo(1),
Expand Down

0 comments on commit 0f72f5b

Please sign in to comment.