Record Class ItemDescription
java.lang.Object
java.lang.Record
com.simibubi.create.foundation.item.ItemDescription
public record ItemDescription(com.google.common.collect.ImmutableList<net.minecraft.network.chat.Component> lines, com.google.common.collect.ImmutableList<net.minecraft.network.chat.Component> linesOnShift, com.google.common.collect.ImmutableList<net.minecraft.network.chat.Component> linesOnCtrl)
extends Record
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic class -
Constructor Summary
ConstructorsConstructorDescriptionItemDescription(com.google.common.collect.ImmutableList<net.minecraft.network.chat.Component> lines, com.google.common.collect.ImmutableList<net.minecraft.network.chat.Component> linesOnShift, com.google.common.collect.ImmutableList<net.minecraft.network.chat.Component> linesOnCtrl) Creates an instance of aItemDescriptionrecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic booleancanFillBuilder(String translationKey) static @Nullable ItemDescriptionstatic @Nullable ItemDescriptioncreate(net.minecraft.world.item.Item item, net.createmod.catnip.lang.FontHelper.Palette palette) final booleanIndicates whether some other object is "equal to" this one.static voidfillBuilder(ItemDescription.Builder builder, String translationKey) com.google.common.collect.ImmutableList<net.minecraft.network.chat.Component> static StringgetTooltipTranslationKey(net.minecraft.world.item.Item item) final inthashCode()Returns a hash code value for this object.com.google.common.collect.ImmutableList<net.minecraft.network.chat.Component> lines()Returns the value of thelinesrecord component.com.google.common.collect.ImmutableList<net.minecraft.network.chat.Component> Returns the value of thelinesOnCtrlrecord component.com.google.common.collect.ImmutableList<net.minecraft.network.chat.Component> Returns the value of thelinesOnShiftrecord component.static voidreferKey(net.minecraft.world.level.ItemLike item, Supplier<? extends net.minecraft.world.level.ItemLike> otherItem) final StringtoString()Returns a string representation of this record class.static voidstatic void
-
Constructor Details
-
ItemDescription
public ItemDescription(com.google.common.collect.ImmutableList<net.minecraft.network.chat.Component> lines, com.google.common.collect.ImmutableList<net.minecraft.network.chat.Component> linesOnShift, com.google.common.collect.ImmutableList<net.minecraft.network.chat.Component> linesOnCtrl) Creates an instance of aItemDescriptionrecord class.- Parameters:
lines- the value for thelinesrecord componentlinesOnShift- the value for thelinesOnShiftrecord componentlinesOnCtrl- the value for thelinesOnCtrlrecord component
-
-
Method Details
-
create
@Nullable public static @Nullable ItemDescription create(net.minecraft.world.item.Item item, net.createmod.catnip.lang.FontHelper.Palette palette) -
create
@Nullable public static @Nullable ItemDescription create(String translationKey, net.createmod.catnip.lang.FontHelper.Palette palette) -
canFillBuilder
-
fillBuilder
-
useKey
-
useKey
-
referKey
public static void referKey(net.minecraft.world.level.ItemLike item, Supplier<? extends net.minecraft.world.level.ItemLike> otherItem) -
getTooltipTranslationKey
-
getCurrentLines
public com.google.common.collect.ImmutableList<net.minecraft.network.chat.Component> getCurrentLines() -
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). -
lines
public com.google.common.collect.ImmutableList<net.minecraft.network.chat.Component> lines()Returns the value of thelinesrecord component.- Returns:
- the value of the
linesrecord component
-
linesOnShift
public com.google.common.collect.ImmutableList<net.minecraft.network.chat.Component> linesOnShift()Returns the value of thelinesOnShiftrecord component.- Returns:
- the value of the
linesOnShiftrecord component
-
linesOnCtrl
public com.google.common.collect.ImmutableList<net.minecraft.network.chat.Component> linesOnCtrl()Returns the value of thelinesOnCtrlrecord component.- Returns:
- the value of the
linesOnCtrlrecord component
-