Record Class InputSettings
java.lang.Object
java.lang.Record
com.pixelmonmod.pixelmon.api.dialogue.InputSettings
- Record Components:
title- The title of the dialogue.description- The description of the dialogue.defaultText- The default text to display in the input box.closeOnEscape- Whether the dialogue should close when the user presses escape.maxLength- The maximum length of the user's input.hideUI- Whether the UI should be hidden while the dialogue is open.showInput- Whether the input box should be shown.acceptedPatterns- The patterns that the user's input must match.- The buttons to display.
public record InputSettings(net.minecraft.network.chat.Component title, net.minecraft.network.chat.Component description, net.minecraft.network.chat.Component defaultText, boolean closeOnEscape, int maxLength, boolean hideUI, boolean showInput, String[] acceptedPatterns, DialogueButton[] buttons)
extends Record
Represents the settings for an input dialogue.
-
Constructor Summary
ConstructorsConstructorDescriptionInputSettings(net.minecraft.network.chat.Component title, net.minecraft.network.chat.Component description, net.minecraft.network.chat.Component defaultText, boolean closeOnEscape, int maxLength, boolean hideUI, boolean showInput, String[] acceptedPatterns, DialogueButton[] buttons) Creates an instance of aInputSettingsrecord class. -
Method Summary
Modifier and TypeMethodDescriptionString[]Returns the value of theacceptedPatternsrecord component.buttons()Returns the value of thebuttonsrecord component.booleanReturns the value of thecloseOnEscaperecord component.static InputSettingsdecode(net.minecraft.network.FriendlyByteBuf buffer) Decodes anInputSettingsfrom the given buffer.net.minecraft.network.chat.ComponentReturns the value of thedefaultTextrecord component.net.minecraft.network.chat.ComponentReturns the value of thedescriptionrecord component.voidencode(net.minecraft.network.FriendlyByteBuf buffer) Encodes theInputSettingsinto the given buffer.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanhideUI()Returns the value of thehideUIrecord component.intReturns the value of themaxLengthrecord component.booleanReturns the value of theshowInputrecord component.net.minecraft.network.chat.Componenttitle()Returns the value of thetitlerecord component.final StringtoString()Returns a string representation of this record class.withAcceptedPatterns(Iterable<String> acceptedPatterns) Creates a copy of theInputSettingswith the accepted patterns set to the given value.withAcceptedPatterns(String... acceptedPatterns) Creates a copy of theInputSettingswith the accepted patterns set to the given value.withButtons(DialogueButton[] buttons) Creates a copy of theInputSettingswith the accepted patterns set to the given value.withButtons(Iterable<DialogueButton> buttons) Creates a copy of theInputSettingswith the accepted patterns set to the given value.Creates a copy of theInputSettingswith the close on escape setting set to true.withCloseOnEscape(boolean closeOnEscape) Creates a copy of theInputSettingswith the close on escape setting set to the given value.withDefaultText(String defaultText) Creates a copy of theInputSettingswith the given default text.withDefaultText(net.minecraft.network.chat.Component defaultText) Creates a copy of theInputSettingswith the given default text.withDescription(String description) Creates a copy of theInputSettingswith the given description.withDescription(net.minecraft.network.chat.Component description) Creates a copy of theInputSettingswith the given description.Creates a copy of theInputSettingswith the show input setting set to false.Creates a copy of theInputSettingswith the hide UI setting set to true.withHideUI(boolean hideUI) Creates a copy of theInputSettingswith the hide UI setting set to the given value.withMaxLength(int maxLength) Creates a copy of theInputSettingswith the maximum length set to the given value.Creates a copy of theInputSettingswith the close on escape setting set to false.Creates a copy of theInputSettingswith the show input setting set to true.withShowInput(boolean showInput) Creates a copy of theInputSettingswith the show input setting set to the given valueCreates a copy of theInputSettingswith the hide UI setting set to false.Creates a copy of theInputSettingswith the given title.withTitle(net.minecraft.network.chat.Component title) Creates a copy of theInputSettingswith the given title.
-
Constructor Details
-
InputSettings
public InputSettings(net.minecraft.network.chat.Component title, net.minecraft.network.chat.Component description, net.minecraft.network.chat.Component defaultText, boolean closeOnEscape, int maxLength, boolean hideUI, boolean showInput, String[] acceptedPatterns, DialogueButton[] buttons) Creates an instance of aInputSettingsrecord class.- Parameters:
title- the value for thetitlerecord componentdescription- the value for thedescriptionrecord componentdefaultText- the value for thedefaultTextrecord componentcloseOnEscape- the value for thecloseOnEscaperecord componentmaxLength- the value for themaxLengthrecord componenthideUI- the value for thehideUIrecord componentshowInput- the value for theshowInputrecord componentacceptedPatterns- the value for theacceptedPatternsrecord componentbuttons- the value for thebuttonsrecord component
-
-
Method Details
-
withTitle
Creates a copy of theInputSettingswith the given title.- Parameters:
title- The title.- Returns:
- The
InputSettings.
-
withTitle
Creates a copy of theInputSettingswith the given title.- Parameters:
title- The title.- Returns:
- The
InputSettings.
-
withDescription
Creates a copy of theInputSettingswith the given description.- Parameters:
description- The description.- Returns:
- The
InputSettings.
-
withDescription
Creates a copy of theInputSettingswith the given description.- Parameters:
description- The description.- Returns:
- The
InputSettings.
-
withDefaultText
Creates a copy of theInputSettingswith the given default text.- Parameters:
defaultText- The default text.- Returns:
- The
InputSettings.
-
withDefaultText
Creates a copy of theInputSettingswith the given default text.- Parameters:
defaultText- The default text.- Returns:
- The
InputSettings.
-
withCloseOnEscape
Creates a copy of theInputSettingswith the close on escape setting set to true.- Returns:
- The
InputSettings.
-
withoutCloseOnEscape
Creates a copy of theInputSettingswith the close on escape setting set to false.- Returns:
- The
InputSettings.
-
withCloseOnEscape
Creates a copy of theInputSettingswith the close on escape setting set to the given value.- Parameters:
closeOnEscape- The close on escape setting.- Returns:
- The
InputSettings.
-
withMaxLength
Creates a copy of theInputSettingswith the maximum length set to the given value.- Parameters:
maxLength- The maximum length.- Returns:
- The
InputSettings.
-
withHideUI
Creates a copy of theInputSettingswith the hide UI setting set to true.- Returns:
- The
InputSettings.
-
withShowUI
Creates a copy of theInputSettingswith the hide UI setting set to false.- Returns:
- The
InputSettings.
-
withHideUI
Creates a copy of theInputSettingswith the hide UI setting set to the given value.- Parameters:
hideUI- The hide UI setting.- Returns:
- The
InputSettings.
-
withShowInput
Creates a copy of theInputSettingswith the show input setting set to true.- Returns:
- The
InputSettings.
-
withHideInput
Creates a copy of theInputSettingswith the show input setting set to false.- Returns:
- The
InputSettings.
-
withShowInput
Creates a copy of theInputSettingswith the show input setting set to the given value- Parameters:
showInput- The show input setting.- Returns:
-
withAcceptedPatterns
Creates a copy of theInputSettingswith the accepted patterns set to the given value.- Parameters:
acceptedPatterns- The accepted patterns.- Returns:
- The
InputSettings.
-
withAcceptedPatterns
Creates a copy of theInputSettingswith the accepted patterns set to the given value.- Parameters:
acceptedPatterns- The accepted patterns.- Returns:
- The
InputSettings.
-
withButtons
Creates a copy of theInputSettingswith the accepted patterns set to the given value.- Parameters:
buttons- The buttons.- Returns:
- The
InputSettings.
-
withButtons
Creates a copy of theInputSettingswith the accepted patterns set to the given value.- Parameters:
buttons- The buttons.- Returns:
- The
InputSettings.
-
encode
public void encode(net.minecraft.network.FriendlyByteBuf buffer) Encodes theInputSettingsinto the given buffer.- Parameters:
buffer- The buffer.
-
decode
Decodes anInputSettingsfrom the given buffer.- Parameters:
buffer- The buffer.- Returns:
- The
InputSettings.
-
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
-
description
public net.minecraft.network.chat.Component description()Returns the value of thedescriptionrecord component.- Returns:
- the value of the
descriptionrecord component
-
defaultText
public net.minecraft.network.chat.Component defaultText()Returns the value of thedefaultTextrecord component.- Returns:
- the value of the
defaultTextrecord component
-
closeOnEscape
public boolean closeOnEscape()Returns the value of thecloseOnEscaperecord component.- Returns:
- the value of the
closeOnEscaperecord component
-
maxLength
public int maxLength()Returns the value of themaxLengthrecord component.- Returns:
- the value of the
maxLengthrecord component
-
hideUI
public boolean hideUI()Returns the value of thehideUIrecord component.- Returns:
- the value of the
hideUIrecord component
-
showInput
public boolean showInput()Returns the value of theshowInputrecord component.- Returns:
- the value of the
showInputrecord component
-
acceptedPatterns
Returns the value of theacceptedPatternsrecord component.- Returns:
- the value of the
acceptedPatternsrecord component
-
buttons
Returns the value of thebuttonsrecord component.- Returns:
- the value of the
buttonsrecord component
-