Record Class ToastData
java.lang.Object
java.lang.Record
com.pixelmonmod.pixelmon.api.util.toast.ToastData
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionToastData(net.minecraft.network.chat.Component title, Color textColor, net.minecraft.world.item.ItemStack icon) ToastData(net.minecraft.network.chat.Component title, Color textColor, net.minecraft.world.item.ItemStack icon, Optional<net.minecraft.core.Holder<net.minecraft.sounds.SoundEvent>> sound, net.minecraft.resources.ResourceLocation backgroundSprite, int displayTime) ToastData(net.minecraft.network.chat.Component title, Color textColor, net.minecraft.world.item.ItemStack icon, net.minecraft.core.Holder<net.minecraft.sounds.SoundEvent> sound, net.minecraft.resources.ResourceLocation backgroundSprite, int displayTime) Creates an instance of aToastDatarecord class. -
Method Summary
Modifier and TypeMethodDescriptionnet.minecraft.resources.ResourceLocationReturns the value of thebackgroundSpriterecord component.intReturns the value of thedisplayTimerecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.net.minecraft.world.item.ItemStackicon()Returns the value of theiconrecord component.net.minecraft.core.Holder<net.minecraft.sounds.SoundEvent> sound()Returns the value of thesoundrecord component.Returns the value of thetextColorrecord component.net.minecraft.network.chat.Componenttitle()Returns the value of thetitlerecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
CODEC
-
-
Constructor Details
-
ToastData
-
ToastData
public ToastData(net.minecraft.network.chat.Component title, Color textColor, net.minecraft.world.item.ItemStack icon) -
ToastData
public ToastData(net.minecraft.network.chat.Component title, Color textColor, net.minecraft.world.item.ItemStack icon, net.minecraft.core.Holder<net.minecraft.sounds.SoundEvent> sound, net.minecraft.resources.ResourceLocation backgroundSprite, int displayTime) Creates an instance of aToastDatarecord class.- Parameters:
title- the value for thetitlerecord componenttextColor- the value for thetextColorrecord componenticon- the value for theiconrecord componentsound- the value for thesoundrecord componentbackgroundSprite- the value for thebackgroundSpriterecord componentdisplayTime- the value for thedisplayTimerecord component
-
-
Method Details
-
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 '=='. -
title
public net.minecraft.network.chat.Component title()Returns the value of thetitlerecord component.- Returns:
- the value of the
titlerecord component
-
textColor
Returns the value of thetextColorrecord component.- Returns:
- the value of the
textColorrecord component
-
icon
public net.minecraft.world.item.ItemStack icon()Returns the value of theiconrecord component.- Returns:
- the value of the
iconrecord component
-
sound
public net.minecraft.core.Holder<net.minecraft.sounds.SoundEvent> sound()Returns the value of thesoundrecord component.- Returns:
- the value of the
soundrecord component
-
backgroundSprite
public net.minecraft.resources.ResourceLocation backgroundSprite()Returns the value of thebackgroundSpriterecord component.- Returns:
- the value of the
backgroundSpriterecord component
-
displayTime
public int displayTime()Returns the value of thedisplayTimerecord component.- Returns:
- the value of the
displayTimerecord component
-