Package dev.latvian.mods.kubejs.util
Record Class NotificationToastData
java.lang.Object
java.lang.Record
dev.latvian.mods.kubejs.util.NotificationToastData
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.MapCodec<NotificationToastData> static final KubeColorstatic final KubeColorstatic final Durationstatic final KubeColorstatic final net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf, NotificationToastData> -
Constructor Summary
ConstructorsConstructorDescriptionNotificationToastData(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 aNotificationToastDatarecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thebackgroundColorrecord component.Returns the value of theborderColorrecord component.duration()Returns the value of thedurationrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.icon()Returns the value of theiconrecord component.inticonSize()Returns the value of theiconSizerecord component.static NotificationToastDataofText(net.minecraft.network.chat.Component text) static NotificationToastDataofTitle(net.minecraft.network.chat.Component title, @Nullable net.minecraft.network.chat.Component text) Returns the value of theoutlineColorrecord component.net.minecraft.network.chat.Componenttext()Returns the value of thetextrecord component.booleanReturns the value of thetextShadowrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
DEFAULT_DURATION
-
DEFAULT_OUTLINE_COLOR
-
DEFAULT_BORDER_COLOR
-
DEFAULT_BACKGROUND_COLOR
-
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 aNotificationToastDatarecord class.- Parameters:
duration- the value for thedurationrecord componenttext- the value for thetextrecord componenticon- the value for theiconrecord componenticonSize- the value for theiconSizerecord componentoutlineColor- the value for theoutlineColorrecord componentborderColor- the value for theborderColorrecord componentbackgroundColor- the value for thebackgroundColorrecord componenttextShadow- the value for thetextShadowrecord component
-
-
Method Details
-
ofText
-
ofTitle
public static NotificationToastData ofTitle(net.minecraft.network.chat.Component title, @Nullable @Nullable net.minecraft.network.chat.Component text) -
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
duration
Returns the value of thedurationrecord component.- Returns:
- the value of the
durationrecord component
-
text
public net.minecraft.network.chat.Component text()Returns the value of thetextrecord component.- Returns:
- the value of the
textrecord component
-
icon
Returns the value of theiconrecord component.- Returns:
- the value of the
iconrecord component
-
iconSize
public int iconSize()Returns the value of theiconSizerecord component.- Returns:
- the value of the
iconSizerecord component
-
outlineColor
Returns the value of theoutlineColorrecord component.- Returns:
- the value of the
outlineColorrecord component
-
borderColor
Returns the value of theborderColorrecord component.- Returns:
- the value of the
borderColorrecord component
-
backgroundColor
Returns the value of thebackgroundColorrecord component.- Returns:
- the value of the
backgroundColorrecord component
-
textShadow
public boolean textShadow()Returns the value of thetextShadowrecord component.- Returns:
- the value of the
textShadowrecord component
-