Record Class PotionBundleString
java.lang.Object
java.lang.Record
com.github.minecraftschurlimods.potionbundles.PotionBundleString
public record PotionBundleString(net.minecraft.core.Holder<net.minecraft.world.item.Item> item, net.minecraft.core.component.DataComponentPatch components)
extends Record
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.MapCodec<PotionBundleString> static final net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf, PotionBundleString> -
Constructor Summary
ConstructorsConstructorDescriptionPotionBundleString(net.minecraft.core.Holder<net.minecraft.world.item.Item> item, net.minecraft.core.component.DataComponentPatch components) Creates an instance of aPotionBundleStringrecord class. -
Method Summary
Modifier and TypeMethodDescriptionnet.minecraft.core.component.DataComponentPatchReturns the value of thecomponentsrecord component.final booleanIndicates whether some other object is "equal to" this one.static PotionBundleStringfromItem(net.minecraft.world.item.Item item) static PotionBundleStringfromItem(net.minecraft.world.item.Item item, net.minecraft.core.component.DataComponentPatch components) static PotionBundleStringfromItemHolder(net.minecraft.core.Holder<net.minecraft.world.item.Item> item) static PotionBundleStringfromItemStack(net.minecraft.world.item.ItemStack itemStack) final inthashCode()Returns a hash code value for this object.net.minecraft.core.Holder<net.minecraft.world.item.Item> item()Returns the value of theitemrecord component.net.minecraft.world.item.ItemStackfinal StringtoString()Returns a string representation of this record class.
-
Field Details
-
CODEC
-
STREAM_CODEC
public static final net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf,PotionBundleString> STREAM_CODEC
-
-
Constructor Details
-
PotionBundleString
public PotionBundleString(net.minecraft.core.Holder<net.minecraft.world.item.Item> item, net.minecraft.core.component.DataComponentPatch components) Creates an instance of aPotionBundleStringrecord class.- Parameters:
item- the value for theitemrecord componentcomponents- the value for thecomponentsrecord component
-
-
Method Details
-
toItemStack
public net.minecraft.world.item.ItemStack toItemStack() -
fromItemHolder
public static PotionBundleString fromItemHolder(net.minecraft.core.Holder<net.minecraft.world.item.Item> item) -
fromItem
-
fromItem
public static PotionBundleString fromItem(net.minecraft.world.item.Item item, net.minecraft.core.component.DataComponentPatch components) -
fromItemStack
-
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). -
item
public net.minecraft.core.Holder<net.minecraft.world.item.Item> item()Returns the value of theitemrecord component.- Returns:
- the value of the
itemrecord component
-
components
public net.minecraft.core.component.DataComponentPatch components()Returns the value of thecomponentsrecord component.- Returns:
- the value of the
componentsrecord component
-