Package appeng.api.storage.cells
Interface IBasicCellItem
- All Superinterfaces:
ICellWorkbenchItem
,net.minecraft.world.level.ItemLike
,IUpgradeableItem
Implement this on any item to register a "basic cell", which is a cell that works similarly to AE2's own item and
fluid cells. There is no need to register an
ICellHandler
for such an item. AE2 automatically handles the
internals and NBT data, which is both nice, and bad for you!
The standard AE implementation also only provides 1-63 Types.-
Method Summary
Modifier and TypeMethodDescriptiondefault void
addCellInformationToTooltip
(net.minecraft.world.item.ItemStack is, List<net.minecraft.network.chat.Component> lines) Convenient helper to append useful tooltip information.int
getBytes
(net.minecraft.world.item.ItemStack cellItem) The number of bytes that can be stored on this type of storage cell.int
getBytesPerType
(net.minecraft.world.item.ItemStack cellItem) Determines the number of bytes used for any type included on the cell.default Optional
<net.minecraft.world.inventory.tooltip.TooltipComponent> getCellTooltipImage
(net.minecraft.world.item.ItemStack is) Helper to get the additional tooltip image line showing the content/filter/upgrades.double
Basic cell items are limited to a singleAEKeyType
.int
getTotalTypes
(net.minecraft.world.item.ItemStack cellItem) Must be between 1 and 63, indicates how many types can be stored on this type of storage cell.default boolean
isBlackListed
(net.minecraft.world.item.ItemStack cellItem, AEKey requestedAddition) Allows you to fine tune which items are allowed on a given cell, if you don't care, just return false; As the handler for this type of cell is still the default cells, the normal AE black list is also applied.default boolean
isStorageCell
(net.minecraft.world.item.ItemStack i) Allows an item to selectively enable or disable its status as a storage cell.default boolean
Allows you to specify if this storage cell can be stored inside other storage cells, only set this for special items like the matter cannon that are not general purpose storage.Methods inherited from interface appeng.api.storage.cells.ICellWorkbenchItem
getConfigInventory, getFuzzyMode, isEditable, setFuzzyMode
Methods inherited from interface net.minecraft.world.level.ItemLike
asItem
Methods inherited from interface appeng.api.upgrades.IUpgradeableItem
getUpgrades
-
Method Details
-
getKeyType
AEKeyType getKeyType()Basic cell items are limited to a singleAEKeyType
. -
getBytes
int getBytes(net.minecraft.world.item.ItemStack cellItem) The number of bytes that can be stored on this type of storage cell. It wont work if the return is not a multiple of 8. The limit is (Integer.MAX_VALUE
+ 1) / 8.- Parameters:
cellItem
- item- Returns:
- number of bytes
-
getBytesPerType
int getBytesPerType(net.minecraft.world.item.ItemStack cellItem) Determines the number of bytes used for any type included on the cell.- Parameters:
cellItem
- item- Returns:
- number of bytes
-
getTotalTypes
int getTotalTypes(net.minecraft.world.item.ItemStack cellItem) Must be between 1 and 63, indicates how many types can be stored on this type of storage cell.- Parameters:
cellItem
- item- Returns:
- number of types
-
isBlackListed
Allows you to fine tune which items are allowed on a given cell, if you don't care, just return false; As the handler for this type of cell is still the default cells, the normal AE black list is also applied.- Parameters:
cellItem
- itemrequestedAddition
- requested addition- Returns:
- true to preventAdditionOfItem
-
storableInStorageCell
default boolean storableInStorageCell()Allows you to specify if this storage cell can be stored inside other storage cells, only set this for special items like the matter cannon that are not general purpose storage.- Returns:
- true if the storage cell can be stored inside other storage cells, this is generally false, except for certain situations such as the matter cannon.
-
isStorageCell
default boolean isStorageCell(net.minecraft.world.item.ItemStack i) Allows an item to selectively enable or disable its status as a storage cell.- Parameters:
i
- item- Returns:
- if the ItemStack should currently be usable as a storage cell.
-
getIdleDrain
double getIdleDrain()- Returns:
- drain in ae/t this storage cell will use.
-
addCellInformationToTooltip
default void addCellInformationToTooltip(net.minecraft.world.item.ItemStack is, List<net.minecraft.network.chat.Component> lines) Convenient helper to append useful tooltip information. -
getCellTooltipImage
default Optional<net.minecraft.world.inventory.tooltip.TooltipComponent> getCellTooltipImage(net.minecraft.world.item.ItemStack is) Helper to get the additional tooltip image line showing the content/filter/upgrades.
-