Record Class DisplayInfo
java.lang.Object
java.lang.Record
net.minecraft.advancements.DisplayInfo
public record DisplayInfo(ItemStackTemplate icon, Component title, Component description, Optional<ClientAsset.ResourceTexture> background, AdvancementType type, boolean showToast, boolean announceToChat, boolean hidden)
extends Record
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final booleanThe field for theannounceToChatrecord component.private final Optional<ClientAsset.ResourceTexture> The field for thebackgroundrecord component.static final com.mojang.serialization.Codec<DisplayInfo> private final ComponentThe field for thedescriptionrecord component.private final booleanThe field for thehiddenrecord component.private final ItemStackTemplateThe field for theiconrecord component.private final booleanThe field for theshowToastrecord component.static final StreamCodec<RegistryFriendlyByteBuf, DisplayInfo> private final ComponentThe field for thetitlerecord component.private final AdvancementTypeThe field for thetyperecord component. -
Constructor Summary
ConstructorsConstructorDescriptionDisplayInfo(ItemStackTemplate icon, Component title, Component description, Optional<ClientAsset.ResourceTexture> background, AdvancementType type, boolean showToast, boolean announceToChat, boolean hidden) Creates an instance of aDisplayInforecord class. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns the value of theannounceToChatrecord component.Returns the value of thebackgroundrecord component.Returns the value of thedescriptionrecord component.final booleanIndicates whether some other object is "equal to" this one.private static DisplayInfofinal inthashCode()Returns a hash code value for this object.booleanhidden()Returns the value of thehiddenrecord component.icon()Returns the value of theiconrecord component.private voidbooleanReturns the value of theshowToastrecord component.title()Returns the value of thetitlerecord component.final StringtoString()Returns a string representation of this record class.type()Returns the value of thetyperecord component.
-
Field Details
-
icon
The field for theiconrecord component. -
title
The field for thetitlerecord component. -
description
The field for thedescriptionrecord component. -
background
The field for thebackgroundrecord component. -
type
The field for thetyperecord component. -
showToast
private final boolean showToastThe field for theshowToastrecord component. -
announceToChat
private final boolean announceToChatThe field for theannounceToChatrecord component. -
CODEC
-
STREAM_CODEC
-
-
Constructor Details
-
DisplayInfo
public DisplayInfo(ItemStackTemplate icon, Component title, Component description, Optional<ClientAsset.ResourceTexture> background, AdvancementType type, boolean showToast, boolean announceToChat, boolean hidden) Creates an instance of aDisplayInforecord class.- Parameters:
icon- the value for theiconrecord componenttitle- the value for thetitlerecord componentdescription- the value for thedescriptionrecord componentbackground- the value for thebackgroundrecord componenttype- the value for thetyperecord componentshowToast- the value for theshowToastrecord componentannounceToChat- the value for theannounceToChatrecord componenthidden- the value for thehiddenrecord component
-
-
Method Details
-
serializeToNetwork
-
fromNetwork
-
toString
-
hashCode
-
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 thecomparemethod from their corresponding wrapper classes. -
icon
Returns the value of theiconrecord component.- Returns:
- the value of the
iconrecord component
-
title
Returns the value of thetitlerecord component.- Returns:
- the value of the
titlerecord component
-
description
Returns the value of thedescriptionrecord component.- Returns:
- the value of the
descriptionrecord component
-
background
Returns the value of thebackgroundrecord component.- Returns:
- the value of the
backgroundrecord component
-
type
Returns the value of thetyperecord component.- Returns:
- the value of the
typerecord component
-
showToast
public boolean showToast()Returns the value of theshowToastrecord component.- Returns:
- the value of the
showToastrecord component
-
announceToChat
public boolean announceToChat()Returns the value of theannounceToChatrecord component.- Returns:
- the value of the
announceToChatrecord component
-