diff --git a/common/src/main/java/gripe/_90/megacells/MEGACells.java b/common/src/main/java/gripe/_90/megacells/MEGACells.java index 8e9a24f2..1f297543 100644 --- a/common/src/main/java/gripe/_90/megacells/MEGACells.java +++ b/common/src/main/java/gripe/_90/megacells/MEGACells.java @@ -11,11 +11,13 @@ import net.minecraft.resources.ResourceLocation; import appeng.api.client.StorageCellModels; +import appeng.api.features.HotkeyAction; import appeng.api.networking.GridServices; import appeng.api.storage.StorageCells; import appeng.api.upgrades.Upgrades; import appeng.core.definitions.AEItems; import appeng.core.localization.GuiText; +import appeng.hotkeys.HotkeyActions; import gripe._90.megacells.core.Addons; import gripe._90.megacells.core.Platform; @@ -69,6 +71,11 @@ private static void initStorageCells() { StorageCells.addCellHandler(MEGABulkCell.HANDLER); StorageCellModels.registerModel(MEGAItems.BULK_ITEM_CELL, MEGACells.makeId("block/drive/cells/bulk_item_cell")); + MEGAItems.getItemPortables() + .forEach(cell -> HotkeyActions.registerPortableCell(cell, HotkeyAction.PORTABLE_ITEM_CELL)); + MEGAItems.getFluidPortables() + .forEach(cell -> HotkeyActions.registerPortableCell(cell, HotkeyAction.PORTABLE_FLUID_CELL)); + if (MEGACells.PLATFORM.isAddonLoaded(Addons.APPBOT)) { Stream.of(AppBotItems.getCells(), AppBotItems.getPortables()) .flatMap(Collection::stream) 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 64c2aa12..a6967a14 100644 --- a/common/src/main/java/gripe/_90/megacells/definition/MEGAItems.java +++ b/common/src/main/java/gripe/_90/megacells/definition/MEGAItems.java @@ -19,6 +19,7 @@ import appeng.items.parts.PartModelsHelper; import appeng.items.storage.BasicStorageCell; import appeng.items.storage.StorageTier; +import appeng.items.tools.powered.AbstractPortableCell; import appeng.menu.me.common.MEStorageMenu; import gripe._90.megacells.MEGACells; @@ -126,7 +127,7 @@ public static List> getFluidCells() { return List.of(FLUID_CELL_1M, FLUID_CELL_4M, FLUID_CELL_16M, FLUID_CELL_64M, FLUID_CELL_256M); } - public static List> getItemPortables() { + public static List> getItemPortables() { return List.of( PORTABLE_ITEM_CELL_1M, PORTABLE_ITEM_CELL_4M, @@ -135,7 +136,7 @@ public static List> getItemPortables() { PORTABLE_ITEM_CELL_256M); } - public static List> getFluidPortables() { + public static List> getFluidPortables() { return List.of( PORTABLE_FLUID_CELL_1M, PORTABLE_FLUID_CELL_4M, diff --git a/common/src/main/java/gripe/_90/megacells/integration/appbot/AppBotItems.java b/common/src/main/java/gripe/_90/megacells/integration/appbot/AppBotItems.java index 11822bca..f1d3ee5e 100644 --- a/common/src/main/java/gripe/_90/megacells/integration/appbot/AppBotItems.java +++ b/common/src/main/java/gripe/_90/megacells/integration/appbot/AppBotItems.java @@ -5,6 +5,7 @@ import appeng.core.definitions.ItemDefinition; import appeng.items.materials.MaterialItem; import appeng.items.storage.StorageTier; +import appeng.items.tools.powered.AbstractPortableCell; import appbot.item.ManaCellItem; import appbot.item.PortableManaCellItem; @@ -37,7 +38,7 @@ public static List> getCells() { return List.of(MANA_CELL_1M, MANA_CELL_4M, MANA_CELL_16M, MANA_CELL_64M, MANA_CELL_256M); } - public static List> getPortables() { + public static List> getPortables() { return List.of( PORTABLE_MANA_CELL_1M, PORTABLE_MANA_CELL_4M, diff --git a/forge/src/main/java/gripe/_90/megacells/integration/appmek/AppMekItems.java b/forge/src/main/java/gripe/_90/megacells/integration/appmek/AppMekItems.java index fd012807..92e552d9 100644 --- a/forge/src/main/java/gripe/_90/megacells/integration/appmek/AppMekItems.java +++ b/forge/src/main/java/gripe/_90/megacells/integration/appmek/AppMekItems.java @@ -5,6 +5,7 @@ import appeng.core.definitions.ItemDefinition; import appeng.items.materials.MaterialItem; import appeng.items.storage.StorageTier; +import appeng.items.tools.powered.AbstractPortableCell; import me.ramidzkh.mekae2.item.ChemicalStorageCell; @@ -48,7 +49,7 @@ public static List> getCells() { return List.of(CHEMICAL_CELL_1M, CHEMICAL_CELL_4M, CHEMICAL_CELL_16M, CHEMICAL_CELL_64M, CHEMICAL_CELL_256M); } - public static List> getPortables() { + public static List> getPortables() { return List.of( PORTABLE_CHEMICAL_CELL_1M, PORTABLE_CHEMICAL_CELL_4M,