Record Class HoldingEnchantableProvider.COFHVolumeModifier

java.lang.Object
java.lang.Record
me.desht.pneumaticcraft.common.thirdparty.cofhcore.HoldingEnchantableProvider.COFHVolumeModifier
All Implemented Interfaces:
ItemVolumeModifier
Enclosing class:
HoldingEnchantableProvider

public static record HoldingEnchantableProvider.COFHVolumeModifier(net.minecraft.world.item.enchantment.Enchantment holding) extends Record implements ItemVolumeModifier
  • Constructor Summary

    Constructors
    Constructor
    Description
    COFHVolumeModifier(net.minecraft.world.item.enchantment.Enchantment holding)
    Creates an instance of a COFHVolumeModifier record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    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.
    final boolean
    Indicates whether some other object is "equal to" this one.
    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
    final int
    Returns a hash code value for this object.
    net.minecraft.world.item.enchantment.Enchantment
    Returns the value of the holding record component.
    final String
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • COFHVolumeModifier

      public COFHVolumeModifier(net.minecraft.world.item.enchantment.Enchantment holding)
      Creates an instance of a COFHVolumeModifier record class.
      Parameters:
      holding - the value for the holding record component
  • Method Details

    • getNewVolume

      public int getNewVolume(net.minecraft.world.item.ItemStack stack, int oldVolume)
      Description copied from interface: ItemVolumeModifier
      Given an item stack, which is a pneumatic item, and its current volume, return a new, modified volume
      Specified by:
      getNewVolume in interface ItemVolumeModifier
      Parameters:
      stack - the item
      oldVolume - the initial volume
      Returns:
      the modified volume
    • addInfo

      public void addInfo(net.minecraft.world.item.ItemStack stack, List<net.minecraft.network.chat.Component> text)
      Description copied from interface: ItemVolumeModifier
      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.
      Specified by:
      addInfo in interface ItemVolumeModifier
      Parameters:
      stack - the item
      text - information text to be appended to
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • holding

      public net.minecraft.world.item.enchantment.Enchantment holding()
      Returns the value of the holding record component.
      Returns:
      the value of the holding record component