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 Classes
    Modifier and Type
    Class
    Description
    static class 
     
    static class 
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    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 a ItemDescription record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    static boolean
    canFillBuilder(String translationKey)
     
    static @Nullable ItemDescription
    create(String translationKey, net.createmod.catnip.lang.FontHelper.Palette palette)
     
    static @Nullable ItemDescription
    create(net.minecraft.world.item.Item item, net.createmod.catnip.lang.FontHelper.Palette palette)
     
    final boolean
    Indicates whether some other object is "equal to" this one.
    static void
    fillBuilder(ItemDescription.Builder builder, String translationKey)
     
    com.google.common.collect.ImmutableList<net.minecraft.network.chat.Component>
     
    static String
    getTooltipTranslationKey(net.minecraft.world.item.Item item)
     
    final int
    Returns a hash code value for this object.
    com.google.common.collect.ImmutableList<net.minecraft.network.chat.Component>
    Returns the value of the lines record component.
    com.google.common.collect.ImmutableList<net.minecraft.network.chat.Component>
    Returns the value of the linesOnCtrl record component.
    com.google.common.collect.ImmutableList<net.minecraft.network.chat.Component>
    Returns the value of the linesOnShift record component.
    static void
    referKey(net.minecraft.world.level.ItemLike item, Supplier<? extends net.minecraft.world.level.ItemLike> otherItem)
     
    final String
    Returns a string representation of this record class.
    static void
    useKey(net.minecraft.world.item.Item item, Supplier<String> supplier)
     
    static void
    useKey(net.minecraft.world.level.ItemLike item, String string)
     

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • 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 a ItemDescription record class.
      Parameters:
      lines - the value for the lines record component
      linesOnShift - the value for the linesOnShift record component
      linesOnCtrl - the value for the linesOnCtrl record 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

      public static boolean canFillBuilder(String translationKey)
    • fillBuilder

      public static void fillBuilder(ItemDescription.Builder builder, String translationKey)
    • useKey

      public static void useKey(net.minecraft.world.item.Item item, Supplier<String> supplier)
    • useKey

      public static void useKey(net.minecraft.world.level.ItemLike item, String string)
    • referKey

      public static void referKey(net.minecraft.world.level.ItemLike item, Supplier<? extends net.minecraft.world.level.ItemLike> otherItem)
    • getTooltipTranslationKey

      public static String getTooltipTranslationKey(net.minecraft.world.item.Item item)
    • getCurrentLines

      public com.google.common.collect.ImmutableList<net.minecraft.network.chat.Component> getCurrentLines()
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • lines

      public com.google.common.collect.ImmutableList<net.minecraft.network.chat.Component> lines()
      Returns the value of the lines record component.
      Returns:
      the value of the lines record component
    • linesOnShift

      public com.google.common.collect.ImmutableList<net.minecraft.network.chat.Component> linesOnShift()
      Returns the value of the linesOnShift record component.
      Returns:
      the value of the linesOnShift record component
    • linesOnCtrl

      public com.google.common.collect.ImmutableList<net.minecraft.network.chat.Component> linesOnCtrl()
      Returns the value of the linesOnCtrl record component.
      Returns:
      the value of the linesOnCtrl record component