Record Class NotificationToastData

java.lang.Object
java.lang.Record
dev.latvian.mods.kubejs.util.NotificationToastData

public record NotificationToastData(Duration duration, net.minecraft.network.chat.Component text, Optional<KubeIcon> icon, int iconSize, Optional<KubeColor> outlineColor, Optional<KubeColor> borderColor, Optional<KubeColor> backgroundColor, boolean textShadow) extends Record
  • Field Details

    • DEFAULT_DURATION

      public static final Duration DEFAULT_DURATION
    • DEFAULT_OUTLINE_COLOR

      public static final KubeColor DEFAULT_OUTLINE_COLOR
    • DEFAULT_BORDER_COLOR

      public static final KubeColor DEFAULT_BORDER_COLOR
    • DEFAULT_BACKGROUND_COLOR

      public static final KubeColor DEFAULT_BACKGROUND_COLOR
    • CODEC

      public static final com.mojang.serialization.MapCodec<NotificationToastData> CODEC
    • STREAM_CODEC

      public static final net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf,NotificationToastData> STREAM_CODEC
  • Constructor Details

    • NotificationToastData

      public NotificationToastData(Duration duration, net.minecraft.network.chat.Component text, Optional<KubeIcon> icon, int iconSize, Optional<KubeColor> outlineColor, Optional<KubeColor> borderColor, Optional<KubeColor> backgroundColor, boolean textShadow)
      Creates an instance of a NotificationToastData record class.
      Parameters:
      duration - the value for the duration record component
      text - the value for the text record component
      icon - the value for the icon record component
      iconSize - the value for the iconSize record component
      outlineColor - the value for the outlineColor record component
      borderColor - the value for the borderColor record component
      backgroundColor - the value for the backgroundColor record component
      textShadow - the value for the textShadow record component
  • Method Details

    • ofText

      public static NotificationToastData ofText(net.minecraft.network.chat.Component text)
    • ofTitle

      public static NotificationToastData ofTitle(net.minecraft.network.chat.Component title, @Nullable @Nullable net.minecraft.network.chat.Component text)
    • 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. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      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.
    • duration

      public Duration duration()
      Returns the value of the duration record component.
      Returns:
      the value of the duration record component
    • text

      public net.minecraft.network.chat.Component text()
      Returns the value of the text record component.
      Returns:
      the value of the text record component
    • icon

      public Optional<KubeIcon> icon()
      Returns the value of the icon record component.
      Returns:
      the value of the icon record component
    • iconSize

      public int iconSize()
      Returns the value of the iconSize record component.
      Returns:
      the value of the iconSize record component
    • outlineColor

      public Optional<KubeColor> outlineColor()
      Returns the value of the outlineColor record component.
      Returns:
      the value of the outlineColor record component
    • borderColor

      public Optional<KubeColor> borderColor()
      Returns the value of the borderColor record component.
      Returns:
      the value of the borderColor record component
    • backgroundColor

      public Optional<KubeColor> backgroundColor()
      Returns the value of the backgroundColor record component.
      Returns:
      the value of the backgroundColor record component
    • textShadow

      public boolean textShadow()
      Returns the value of the textShadow record component.
      Returns:
      the value of the textShadow record component