Interface ItemVolumeModifier

All Known Implementing Classes:
HoldingEnchantableProvider.C0FHVolumeModifier
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface ItemVolumeModifier
A functional interface to modify a given Pneumatic item's effective volume based on attributes of the item stack (generally values in its NBT, e.g. upgrades or enchantments). Instances of this can be registered with IItemRegistry.registerPneumaticVolumeModifier(ItemVolumeModifier).
  • Method Summary

    Modifier and Type
    Method
    Description
    default void
    addInfo(net.minecraft.world.item.ItemStack stack, List<net.minecraft.network.chat.Component> text)
    Add some information regarding this volume modifier for GUI display purposes; this information will be displayed in the Charging Station upgrade screen for the item in the Charging Station.
    int
    getNewVolume(net.minecraft.world.item.ItemStack stack, int oldVolume)
    Given an item stack, which is a pneumatic item, and its current volume, return a new, modified volume
  • Method Details

    • getNewVolume

      int getNewVolume(net.minecraft.world.item.ItemStack stack, int oldVolume)
      Given an item stack, which is a pneumatic item, and its current volume, return a new, modified volume
      Parameters:
      stack - the item
      oldVolume - the initial volume
      Returns:
      the modified volume
    • addInfo

      default void addInfo(net.minecraft.world.item.ItemStack stack, List<net.minecraft.network.chat.Component> text)
      Add some information regarding this volume modifier for GUI display purposes; this information will be displayed in the Charging Station upgrade screen for the item in the Charging Station.
      Parameters:
      stack - the item
      text - information text to be appended to