Record Class SimpleDropProvider.SimpleDrop
java.lang.Object
java.lang.Record
net.darkhax.botanypots.common.impl.data.itemdrops.SimpleDropProvider.SimpleDrop
- Enclosing class:
SimpleDropProvider
public static record SimpleDropProvider.SimpleDrop(net.minecraft.world.item.ItemStack drop, float chance)
extends Record
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.MapCodec<SimpleDropProvider.SimpleDrop> static final net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf, SimpleDropProvider.SimpleDrop> -
Constructor Summary
ConstructorsConstructorDescriptionSimpleDrop(net.minecraft.world.item.ItemStack drop, float chance) Creates an instance of aSimpleDroprecord class. -
Method Summary
Modifier and TypeMethodDescriptionfloatchance()Returns the value of thechancerecord component.net.minecraft.world.item.ItemStackdrop()Returns the value of thedroprecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
CODEC
-
STREAM
public static final net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf,SimpleDropProvider.SimpleDrop> STREAM
-
-
Constructor Details
-
SimpleDrop
public SimpleDrop(net.minecraft.world.item.ItemStack drop, float chance) Creates an instance of aSimpleDroprecord class.- Parameters:
drop- the value for thedroprecord componentchance- the value for thechancerecord component
-
-
Method Details
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
drop
public net.minecraft.world.item.ItemStack drop()Returns the value of thedroprecord component.- Returns:
- the value of the
droprecord component
-
chance
public float chance()Returns the value of thechancerecord component.- Returns:
- the value of the
chancerecord component
-