Record Class QualityItemStackNumberProvider
java.lang.Object
java.lang.Record
petrolpark.mc.library.core.data.numberProvider.itemStack.QualityItemStackNumberProvider
- All Implemented Interfaces:
net.minecraft.world.level.storage.loot.LootContextUser,ItemStackNumberProvider
@ParametersAreNonnullByDefault
public record QualityItemStackNumberProvider(QualityItemStackNumberProvider.QualityValue value)
extends Record
implements ItemStackNumberProvider
petrolpark:quality
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.MapCodec<QualityItemStackNumberProvider> Fields inherited from interface petrolpark.mc.library.core.data.numberProvider.itemStack.ItemStackNumberProvider
TYPED_CODEC -
Constructor Summary
ConstructorsConstructorDescriptionCreates an instance of aQualityItemStackNumberProviderrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.Get the approximate bounds for theoutputof thisItemStackNumberProvideron a best-effort basis.floatgetFloat(net.minecraft.world.item.ItemStack stack, net.minecraft.world.level.storage.loot.LootContext lootContext) intgetInt(net.minecraft.world.item.ItemStack stack, net.minecraft.world.level.storage.loot.LootContext lootContext) final inthashCode()Returns a hash code value for this object.final StringtoString()Returns a string representation of this record class.value()Returns the value of thevaluerecord component.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface petrolpark.mc.library.core.data.numberProvider.itemStack.ItemStackNumberProvider
getMaxFloatMethods inherited from interface net.minecraft.world.level.storage.loot.LootContextUser
getReferencedContextParams, validate
-
Field Details
-
CODEC
-
-
Constructor Details
-
QualityItemStackNumberProvider
Creates an instance of aQualityItemStackNumberProviderrecord class.- Parameters:
value- the value for thevaluerecord component
-
-
Method Details
-
getFloat
public float getFloat(net.minecraft.world.item.ItemStack stack, net.minecraft.world.level.storage.loot.LootContext lootContext) - Specified by:
getFloatin interfaceItemStackNumberProvider
-
getInt
public int getInt(net.minecraft.world.item.ItemStack stack, net.minecraft.world.level.storage.loot.LootContext lootContext) - Specified by:
getIntin interfaceItemStackNumberProvider
-
getEstimate
Description copied from interface:ItemStackNumberProviderGet the approximate bounds for theoutputof thisItemStackNumberProvideron a best-effort basis.- Specified by:
getEstimatein interfaceItemStackNumberProvider- See Also:
-
getItemStackNumberProviderType
- Specified by:
getItemStackNumberProviderTypein interfaceItemStackNumberProvider
-
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). -
value
Returns the value of thevaluerecord component.- Returns:
- the value of the
valuerecord component
-