Record Class ToastData
java.lang.Object
java.lang.Record
com.pixelmonmod.pixelmon.api.util.toast.ToastData
-
Field Summary
-
Constructor Summary
ConstructorDescriptionToastData
(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 aToastData
record class. -
Method Summary
Modifier and TypeMethodDescriptionnet.minecraft.resources.ResourceLocation
Returns the value of thebackgroundSprite
record component.int
Returns the value of thedisplayTime
record component.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.net.minecraft.world.item.ItemStack
icon()
Returns the value of theicon
record component.net.minecraft.core.Holder<net.minecraft.sounds.SoundEvent>
sound()
Returns the value of thesound
record component.Returns the value of thetextColor
record component.net.minecraft.network.chat.Component
title()
Returns the value of thetitle
record component.final String
toString()
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 aToastData
record class.- Parameters:
title
- the value for thetitle
record componenttextColor
- the value for thetextColor
record componenticon
- the value for theicon
record componentsound
- the value for thesound
record componentbackgroundSprite
- the value for thebackgroundSprite
record componentdisplayTime
- the value for thedisplayTime
record 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 thetitle
record component.- Returns:
- the value of the
title
record component
-
textColor
Returns the value of thetextColor
record component.- Returns:
- the value of the
textColor
record component
-
icon
public net.minecraft.world.item.ItemStack icon()Returns the value of theicon
record component.- Returns:
- the value of the
icon
record component
-
sound
public net.minecraft.core.Holder<net.minecraft.sounds.SoundEvent> sound()Returns the value of thesound
record component.- Returns:
- the value of the
sound
record component
-
backgroundSprite
public net.minecraft.resources.ResourceLocation backgroundSprite()Returns the value of thebackgroundSprite
record component.- Returns:
- the value of the
backgroundSprite
record component
-
displayTime
public int displayTime()Returns the value of thedisplayTime
record component.- Returns:
- the value of the
displayTime
record component
-