Class UpgradeInventories

java.lang.Object
appeng.api.upgrades.UpgradeInventories

public final class UpgradeInventories extends Object
Utilities for creating upgrade inventories.
  • Method Details

    • empty

      public static IUpgradeInventory empty()
      Returns an empty, read-only upgrade inventory.
    • forMachine

      public static IUpgradeInventory forMachine(net.minecraft.world.level.ItemLike machineType, int maxUpgrades, MachineUpgradesChanged changeCallback)
      Creates an upgrade inventory that manages the upgrades inserted into an upgradable item stack such as portable cells or wireless terminals. Ensure to save your machine to disk when the upgrades change using the given callback.
    • forItem

      public static IUpgradeInventory forItem(net.minecraft.world.item.ItemStack stack, int maxUpgrades)
      Creates an upgrade inventory that manages the upgrades inserted into an upgradable item stack such as portable cells or wireless terminals. Changes to the upgrades are immediately written into the given stack's NBT.
    • forItem

      public static IUpgradeInventory forItem(net.minecraft.world.item.ItemStack stack, int maxUpgrades, ItemUpgradesChanged changeCallback)
      Same as forItem(ItemStack, int), but with change notifications.