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.
buttons - 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 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 a InputSettings record class.
      Parameters:
      title - the value for the title record component
      description - the value for the description record component
      defaultText - the value for the defaultText record component
      closeOnEscape - the value for the closeOnEscape record component
      maxLength - the value for the maxLength record component
      hideUI - the value for the hideUI record component
      showInput - the value for the showInput record component
      acceptedPatterns - the value for the acceptedPatterns record component
      buttons - the value for the buttons record component
  • Method Details

    • withTitle

      public InputSettings withTitle(String title)
      Creates a copy of the InputSettings with the given title.
      Parameters:
      title - The title.
      Returns:
      The InputSettings.
    • withTitle

      public InputSettings withTitle(net.minecraft.network.chat.Component title)
      Creates a copy of the InputSettings with the given title.
      Parameters:
      title - The title.
      Returns:
      The InputSettings.
    • withDescription

      public InputSettings withDescription(String description)
      Creates a copy of the InputSettings with the given description.
      Parameters:
      description - The description.
      Returns:
      The InputSettings.
    • withDescription

      public InputSettings withDescription(net.minecraft.network.chat.Component description)
      Creates a copy of the InputSettings with the given description.
      Parameters:
      description - The description.
      Returns:
      The InputSettings.
    • withDefaultText

      public InputSettings withDefaultText(String defaultText)
      Creates a copy of the InputSettings with the given default text.
      Parameters:
      defaultText - The default text.
      Returns:
      The InputSettings.
    • withDefaultText

      public InputSettings withDefaultText(net.minecraft.network.chat.Component defaultText)
      Creates a copy of the InputSettings with the given default text.
      Parameters:
      defaultText - The default text.
      Returns:
      The InputSettings.
    • withCloseOnEscape

      public InputSettings withCloseOnEscape()
      Creates a copy of the InputSettings with the close on escape setting set to true.
      Returns:
      The InputSettings.
    • withoutCloseOnEscape

      public InputSettings withoutCloseOnEscape()
      Creates a copy of the InputSettings with the close on escape setting set to false.
      Returns:
      The InputSettings.
    • withCloseOnEscape

      public InputSettings withCloseOnEscape(boolean closeOnEscape)
      Creates a copy of the InputSettings with the close on escape setting set to the given value.
      Parameters:
      closeOnEscape - The close on escape setting.
      Returns:
      The InputSettings.
    • withMaxLength

      public InputSettings withMaxLength(int maxLength)
      Creates a copy of the InputSettings with the maximum length set to the given value.
      Parameters:
      maxLength - The maximum length.
      Returns:
      The InputSettings.
    • withHideUI

      public InputSettings withHideUI()
      Creates a copy of the InputSettings with the hide UI setting set to true.
      Returns:
      The InputSettings.
    • withShowUI

      public InputSettings withShowUI()
      Creates a copy of the InputSettings with the hide UI setting set to false.
      Returns:
      The InputSettings.
    • withHideUI

      public InputSettings withHideUI(boolean hideUI)
      Creates a copy of the InputSettings with the hide UI setting set to the given value.
      Parameters:
      hideUI - The hide UI setting.
      Returns:
      The InputSettings.
    • withShowInput

      public InputSettings withShowInput()
      Creates a copy of the InputSettings with the show input setting set to true.
      Returns:
      The InputSettings.
    • withHideInput

      public InputSettings withHideInput()
      Creates a copy of the InputSettings with the show input setting set to false.
      Returns:
      The InputSettings.
    • withShowInput

      public InputSettings withShowInput(boolean showInput)
      Creates a copy of the InputSettings with the show input setting set to the given value
      Parameters:
      showInput - The show input setting.
      Returns:
    • withAcceptedPatterns

      public InputSettings withAcceptedPatterns(Iterable<String> acceptedPatterns)
      Creates a copy of the InputSettings with the accepted patterns set to the given value.
      Parameters:
      acceptedPatterns - The accepted patterns.
      Returns:
      The InputSettings.
    • withAcceptedPatterns

      public InputSettings withAcceptedPatterns(String... acceptedPatterns)
      Creates a copy of the InputSettings with the accepted patterns set to the given value.
      Parameters:
      acceptedPatterns - The accepted patterns.
      Returns:
      The InputSettings.
    • withButtons

      public InputSettings withButtons(Iterable<DialogueButton> buttons)
      Creates a copy of the InputSettings with the accepted patterns set to the given value.
      Parameters:
      buttons - The buttons.
      Returns:
      The InputSettings.
    • withButtons

      public InputSettings withButtons(DialogueButton[] buttons)
      Creates a copy of the InputSettings 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 the InputSettings into the given buffer.
      Parameters:
      buffer - The buffer.
    • decode

      public static InputSettings decode(net.minecraft.network.FriendlyByteBuf buffer)
      Decodes an InputSettings from the given buffer.
      Parameters:
      buffer - The buffer.
      Returns:
      The InputSettings.
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • title

      public net.minecraft.network.chat.Component title()
      Returns the value of the title record component.
      Returns:
      the value of the title record component
    • description

      public net.minecraft.network.chat.Component description()
      Returns the value of the description record component.
      Returns:
      the value of the description record component
    • defaultText

      public net.minecraft.network.chat.Component defaultText()
      Returns the value of the defaultText record component.
      Returns:
      the value of the defaultText record component
    • closeOnEscape

      public boolean closeOnEscape()
      Returns the value of the closeOnEscape record component.
      Returns:
      the value of the closeOnEscape record component
    • maxLength

      public int maxLength()
      Returns the value of the maxLength record component.
      Returns:
      the value of the maxLength record component
    • hideUI

      public boolean hideUI()
      Returns the value of the hideUI record component.
      Returns:
      the value of the hideUI record component
    • showInput

      public boolean showInput()
      Returns the value of the showInput record component.
      Returns:
      the value of the showInput record component
    • acceptedPatterns

      public String[] acceptedPatterns()
      Returns the value of the acceptedPatterns record component.
      Returns:
      the value of the acceptedPatterns record component
    • buttons

      public DialogueButton[] buttons()
      Returns the value of the buttons record component.
      Returns:
      the value of the buttons record component