Record Class SimpleQualityEffectDescription
java.lang.Object
java.lang.Record
petrolpark.mc.pquality.core.client.effectDescription.SimpleQualityEffectDescription
- All Implemented Interfaces:
IQualityEffectDescription
public record SimpleQualityEffectDescription(net.minecraft.resources.ResourceLocation id, Supplier<Boolean> condition, List<net.minecraft.world.item.ItemStack> applicableStacks)
extends Record
implements IQualityEffectDescription
-
Constructor Summary
ConstructorsConstructorDescriptionSimpleQualityEffectDescription(net.minecraft.resources.ResourceLocation id, Supplier<Boolean> condition, List<net.minecraft.world.item.ItemStack> applicableStacks) Creates an instance of aSimpleQualityEffectDescriptionrecord class. -
Method Summary
Modifier and TypeMethodDescriptionList<net.minecraft.world.item.ItemStack> Returns the value of theapplicableStacksrecord component.Returns the value of theconditionrecord component.final booleanIndicates whether some other object is "equal to" this one.List<net.minecraft.network.chat.FormattedText> getDescription(net.minecraft.world.item.ItemStack stack, IQuality quality) final inthashCode()Returns a hash code value for this object.net.minecraft.resources.ResourceLocationid()Returns the value of theidrecord component.booleanStream<net.minecraft.world.item.ItemStack> final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
SimpleQualityEffectDescription
public SimpleQualityEffectDescription(net.minecraft.resources.ResourceLocation id, Supplier<Boolean> condition, List<net.minecraft.world.item.ItemStack> applicableStacks) Creates an instance of aSimpleQualityEffectDescriptionrecord class.- Parameters:
id- the value for theidrecord componentcondition- the value for theconditionrecord componentapplicableStacks- the value for theapplicableStacksrecord component
-
-
Method Details
-
isEnabled
public boolean isEnabled()- Specified by:
isEnabledin interfaceIQualityEffectDescription
-
streamApplicableItemStacks
- Specified by:
streamApplicableItemStacksin interfaceIQualityEffectDescription
-
getDescription
public List<net.minecraft.network.chat.FormattedText> getDescription(net.minecraft.world.item.ItemStack stack, IQuality quality) - Specified by:
getDescriptionin interfaceIQualityEffectDescription
-
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). -
id
public net.minecraft.resources.ResourceLocation id()Returns the value of theidrecord component.- Specified by:
idin interfaceIQualityEffectDescription- Returns:
- the value of the
idrecord component
-
condition
Returns the value of theconditionrecord component.- Returns:
- the value of the
conditionrecord component
-
applicableStacks
Returns the value of theapplicableStacksrecord component.- Returns:
- the value of the
applicableStacksrecord component
-