Record Class HoldingEnchantableProvider.C0FHVolumeModifier
java.lang.Object
java.lang.Record
me.desht.pneumaticcraft.common.thirdparty.cofhcore.HoldingEnchantableProvider.C0FHVolumeModifier
- All Implemented Interfaces:
ItemVolumeModifier
- Enclosing class:
- HoldingEnchantableProvider
public static record HoldingEnchantableProvider.C0FHVolumeModifier(net.minecraft.world.item.enchantment.Enchantment holding)
extends Record
implements ItemVolumeModifier
-
Constructor Summary
ConstructorsConstructorDescriptionC0FHVolumeModifier(net.minecraft.world.item.enchantment.Enchantment holding) Creates an instance of aC0FHVolumeModifierrecord class. -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd 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 booleanIndicates whether some other object is "equal to" this one.intgetNewVolume(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 volumefinal inthashCode()Returns a hash code value for this object.net.minecraft.world.item.enchantment.Enchantmentholding()Returns the value of theholdingrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
C0FHVolumeModifier
public C0FHVolumeModifier(net.minecraft.world.item.enchantment.Enchantment holding) Creates an instance of aC0FHVolumeModifierrecord class.- Parameters:
holding- the value for theholdingrecord component
-
-
Method Details
-
getNewVolume
public int getNewVolume(net.minecraft.world.item.ItemStack stack, int oldVolume) Description copied from interface:ItemVolumeModifierGiven an item stack, which is a pneumatic item, and its current volume, return a new, modified volume- Specified by:
getNewVolumein interfaceItemVolumeModifier- Parameters:
stack- the itemoldVolume- 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:ItemVolumeModifierAdd 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:
addInfoin interfaceItemVolumeModifier- Parameters:
stack- the itemtext- information text to be appended to
-
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. -
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. -
equals
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 withObjects::equals(Object,Object). -
holding
public net.minecraft.world.item.enchantment.Enchantment holding()Returns the value of theholdingrecord component.- Returns:
- the value of the
holdingrecord component
-