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
ConstructorDescriptionInputSettings
(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 aInputSettings
record class. -
Method Summary
Modifier and TypeMethodDescriptionString[]
Returns the value of theacceptedPatterns
record component.buttons()
Returns the value of thebuttons
record component.boolean
Returns the value of thecloseOnEscape
record component.static InputSettings
decode
(net.minecraft.network.FriendlyByteBuf buffer) Decodes anInputSettings
from the given buffer.net.minecraft.network.chat.Component
Returns the value of thedefaultText
record component.net.minecraft.network.chat.Component
Returns the value of thedescription
record component.void
encode
(net.minecraft.network.FriendlyByteBuf buffer) Encodes theInputSettings
into the given buffer.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.boolean
hideUI()
Returns the value of thehideUI
record component.int
Returns the value of themaxLength
record component.boolean
Returns the value of theshowInput
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.withAcceptedPatterns
(Iterable<String> acceptedPatterns) Creates a copy of theInputSettings
with the accepted patterns set to the given value.withAcceptedPatterns
(String... acceptedPatterns) Creates a copy of theInputSettings
with the accepted patterns set to the given value.withButtons
(DialogueButton[] buttons) Creates a copy of theInputSettings
with the accepted patterns set to the given value.withButtons
(Iterable<DialogueButton> buttons) Creates a copy of theInputSettings
with the accepted patterns set to the given value.Creates a copy of theInputSettings
with the close on escape setting set to true.withCloseOnEscape
(boolean closeOnEscape) Creates a copy of theInputSettings
with the close on escape setting set to the given value.withDefaultText
(String defaultText) Creates a copy of theInputSettings
with the given default text.withDefaultText
(net.minecraft.network.chat.Component defaultText) Creates a copy of theInputSettings
with the given default text.withDescription
(String description) Creates a copy of theInputSettings
with the given description.withDescription
(net.minecraft.network.chat.Component description) Creates a copy of theInputSettings
with the given description.Creates a copy of theInputSettings
with the show input setting set to false.Creates a copy of theInputSettings
with the hide UI setting set to true.withHideUI
(boolean hideUI) Creates a copy of theInputSettings
with the hide UI setting set to the given value.withMaxLength
(int maxLength) Creates a copy of theInputSettings
with the maximum length set to the given value.Creates a copy of theInputSettings
with the close on escape setting set to false.Creates a copy of theInputSettings
with the show input setting set to true.withShowInput
(boolean showInput) Creates a copy of theInputSettings
with the show input setting set to the given valueCreates a copy of theInputSettings
with the hide UI setting set to false.Creates a copy of theInputSettings
with the given title.withTitle
(net.minecraft.network.chat.Component title) Creates a copy of theInputSettings
with 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 aInputSettings
record class.- Parameters:
title
- the value for thetitle
record componentdescription
- the value for thedescription
record componentdefaultText
- the value for thedefaultText
record componentcloseOnEscape
- the value for thecloseOnEscape
record componentmaxLength
- the value for themaxLength
record componenthideUI
- the value for thehideUI
record componentshowInput
- the value for theshowInput
record componentacceptedPatterns
- the value for theacceptedPatterns
record componentbuttons
- the value for thebuttons
record component
-
-
Method Details
-
withTitle
Creates a copy of theInputSettings
with the given title.- Parameters:
title
- The title.- Returns:
- The
InputSettings
.
-
withTitle
Creates a copy of theInputSettings
with the given title.- Parameters:
title
- The title.- Returns:
- The
InputSettings
.
-
withDescription
Creates a copy of theInputSettings
with the given description.- Parameters:
description
- The description.- Returns:
- The
InputSettings
.
-
withDescription
Creates a copy of theInputSettings
with the given description.- Parameters:
description
- The description.- Returns:
- The
InputSettings
.
-
withDefaultText
Creates a copy of theInputSettings
with the given default text.- Parameters:
defaultText
- The default text.- Returns:
- The
InputSettings
.
-
withDefaultText
Creates a copy of theInputSettings
with the given default text.- Parameters:
defaultText
- The default text.- Returns:
- The
InputSettings
.
-
withCloseOnEscape
Creates a copy of theInputSettings
with the close on escape setting set to true.- Returns:
- The
InputSettings
.
-
withoutCloseOnEscape
Creates a copy of theInputSettings
with the close on escape setting set to false.- Returns:
- The
InputSettings
.
-
withCloseOnEscape
Creates a copy of theInputSettings
with 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 theInputSettings
with the maximum length set to the given value.- Parameters:
maxLength
- The maximum length.- Returns:
- The
InputSettings
.
-
withHideUI
Creates a copy of theInputSettings
with the hide UI setting set to true.- Returns:
- The
InputSettings
.
-
withShowUI
Creates a copy of theInputSettings
with the hide UI setting set to false.- Returns:
- The
InputSettings
.
-
withHideUI
Creates a copy of theInputSettings
with the hide UI setting set to the given value.- Parameters:
hideUI
- The hide UI setting.- Returns:
- The
InputSettings
.
-
withShowInput
Creates a copy of theInputSettings
with the show input setting set to true.- Returns:
- The
InputSettings
.
-
withHideInput
Creates a copy of theInputSettings
with the show input setting set to false.- Returns:
- The
InputSettings
.
-
withShowInput
Creates a copy of theInputSettings
with the show input setting set to the given value- Parameters:
showInput
- The show input setting.- Returns:
-
withAcceptedPatterns
Creates a copy of theInputSettings
with the accepted patterns set to the given value.- Parameters:
acceptedPatterns
- The accepted patterns.- Returns:
- The
InputSettings
.
-
withAcceptedPatterns
Creates a copy of theInputSettings
with the accepted patterns set to the given value.- Parameters:
acceptedPatterns
- The accepted patterns.- Returns:
- The
InputSettings
.
-
withButtons
Creates a copy of theInputSettings
with the accepted patterns set to the given value.- Parameters:
buttons
- The buttons.- Returns:
- The
InputSettings
.
-
withButtons
Creates a copy of theInputSettings
with 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 theInputSettings
into the given buffer.- Parameters:
buffer
- The buffer.
-
decode
Decodes anInputSettings
from 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 thetitle
record component.- Returns:
- the value of the
title
record component
-
description
public net.minecraft.network.chat.Component description()Returns the value of thedescription
record component.- Returns:
- the value of the
description
record component
-
defaultText
public net.minecraft.network.chat.Component defaultText()Returns the value of thedefaultText
record component.- Returns:
- the value of the
defaultText
record component
-
closeOnEscape
public boolean closeOnEscape()Returns the value of thecloseOnEscape
record component.- Returns:
- the value of the
closeOnEscape
record component
-
maxLength
public int maxLength()Returns the value of themaxLength
record component.- Returns:
- the value of the
maxLength
record component
-
hideUI
public boolean hideUI()Returns the value of thehideUI
record component.- Returns:
- the value of the
hideUI
record component
-
showInput
public boolean showInput()Returns the value of theshowInput
record component.- Returns:
- the value of the
showInput
record component
-
acceptedPatterns
Returns the value of theacceptedPatterns
record component.- Returns:
- the value of the
acceptedPatterns
record component
-
buttons
Returns the value of thebuttons
record component.- Returns:
- the value of the
buttons
record component
-