Record Class Desc
java.lang.Object
java.lang.Record
com.minecolonies.api.items.component.Desc
Custom usually tooltip component, like ItemLore, but simplier
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionnet.minecraft.network.chat.MutableComponentdesc()Returns the value of thedescrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanisEmpty()static DescreadFromItemStack(net.minecraft.world.item.ItemStack itemStack) final StringtoString()Returns a string representation of this record class.static voidupdateItemStack(net.minecraft.world.item.ItemStack itemStack, UnaryOperator<Desc> updater) voidwriteToItemStack(net.minecraft.world.item.ItemStack itemStack)
-
Field Details
-
EMPTY
-
CODEC
-
STREAM_CODEC
public static final net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf,Desc> STREAM_CODEC
-
-
Constructor Details
-
Desc
public Desc(net.minecraft.network.chat.Component comp) -
Desc
public Desc(net.minecraft.network.chat.MutableComponent desc) Creates an instance of aDescrecord class.- Parameters:
desc- the value for thedescrecord component
-
-
Method Details
-
isEmpty
public boolean isEmpty() -
writeToItemStack
public void writeToItemStack(net.minecraft.world.item.ItemStack itemStack) -
readFromItemStack
-
updateItemStack
public static void updateItemStack(net.minecraft.world.item.ItemStack itemStack, UnaryOperator<Desc> updater) -
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). -
desc
public net.minecraft.network.chat.MutableComponent desc()Returns the value of thedescrecord component.- Returns:
- the value of the
descrecord component
-